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

Feature Request - Return incorrect TestRail ID's in a failed add_results_for_cases call


The call add_results_for_cases returns a simple 400 status code if I make a call with a bad TestRail id included. Is it possible to add a response body to that as well to indicate what the bad TestRail id was so that it is much easier to sift through hundreds / thousands of tests to find the one offender?


Hi Ryan,

Thanks for your posting! The API responses include a descriptive error message in almost all cases and this would also cover responses of type 400. Do you use one of our API bindings to access the API? If you don’t see the message as part of the exceptions, can you step into the send method of the binding and see if a message is returned from TestRail?



I’m using your documented calls:
Starting Post with URL: add_results_for_cases/61 | Data: {results=[{status_id=1, case_id=230x, comment=null}]}

TestRail error: “Field :results.case_id is not a valid ID.”

My request is that in the response you do something along the lines of:
Field :results.case_id 230x is not a valid ID

That will save me hours of looking for that pesky “x” at the end of the testcase ID (when I’m passing in a couple hundred IDs) so that it can be reported properly.

Another “nice to have” would be a response that would indicate that there are duplicate testcase ids that were passed into the “add_results_for_cases” api. Would help to make sure that the copy pasters make sure to check their work and change their testcase IDs.


Hi Ryan,

Ah okay, thanks for the additional details. We will make sure to look into it and a possible option in this case is to make a call to get_cases first and match this with your local list of case IDs to avoid submitting invalid IDs. Regarding duplicate IDs: add_results_for_cases allows multiple results for the same case and this may be useful to submit a series of results per case (e.g. failed, failed, passed).