Join 34,000+ subscribers and receive articles from our
blog about software quality, testing, QA and security.

Add_plan_entry with config_ids says The remote server returned an error: (400) Bad Request


#1

Hello,
I am working on integrating TestRail into our automation script and as of now it works well. Recently my team asked to add the config to the test plan entry we normally create for the test plan. When I tried to do, it throw error like ‘The remote server returned an error: (400) Bad Request.’. Not sure what am I doing wrong. I am sending two request fields I tried and both are failing with same error, Please review and let me know the root cause. Note: If I don’t pass the config_ids it works.

Request Example 1:
{
“suite_id”: 1,
“name”: “Admin OU-System-QA05-Playground-20170522135304”,
“description”: “59234fb19748f321e44e3894”,
“include_all”: false,
“config_ids”: [
2
],
“case_ids”: [
1,
2
]
}

Request Example 2:
{
“suite_id”: 1,
“name”: “Admin OU-System-QA05-Playground-20170522134956”,
“description”: “Test”,
“include_all”: false,
“config_ids”: [
2
],
“runs”: [
{
“include_all”: false,
“case_ids”: [
1,
2
],
“config_ids”: [
2
]
}
]
}


#2

Hi Rudra,

Thanks for your post! A 400 error would usually just indicate a syntax error or similar and the error message should provide a bit more details for this as well. Can you let me know what API call you’re making in addition to the request content you’ve already provided so we can also see the API method you’re using and ensure that the syntax for this is also correct?

Looking forward to your reply!

Regards,
Marco


#3

Hi Marco,

Thanks for your reply. The API method I am using is ‘add_plan_entry’.

URI: add_plan_entry/{planId}

Request Data:
{
“suite_id”: 1,
“name”: “Admin OU-System-QA05-Playground-20170522135304”,
“description”: “Report Id: 59234fb19748f321e44e3894”,
“include_all”: false,
“config_ids”: [2],
“case_ids”: [1,2]
}


#4

Hi Rudra,

Thanks for your reply and the additional details! The add_plan_entry method would expect a test run (or multiple test runs) to be included in the request via the runs field if you also have configurations included in the request. The entry needs to know what to apply to configurations to. You can see a request example on our documentation if you expand the ‘Request Examples’ link, and also provides a detailed explanation of how configurations work with this method:

http://docs.gurock.com/testrail-api2/reference-plans#add_plan_entry

Hope this helps!

Regards,
Marco


#5

Thanks for reply. We are now we have resolved the issue. The only issue we have been facing so far is plan entry having config , update_plan_entry doesn’t work as expected. When I tried to look at past issue, I found this…

Any update when this feature will be available?

Thanks,
Rudra