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

[API] Need a way to get the case IDs in an existing run/entry


#1

Although add_run, update_run, add_plan_entry and update_plan_entry all require an array of case IDs if include_all = false, get_run does not return one.

I have a business case to add results to existing plans/entries but I can’t determine in advance if the test case for which I’m adding the results exists in the plan/entry.

My only alternative at the moment is to attempt the adding of results in a try/catch block.

Thanks
Martin


#2

Hello Martin,

Thanks for your posting. You can use get_tests API method for this:

http://docs.gurock.com/testrail-api2/reference-tests

This returns the list of included tests in a given run and this also includes the related case IDs (case_id attribute).

Regards,
Tobias


#3

Hi Tobias,

May I suggest that you update the documentation for get_run to indicate that this is how to get tests in runs.

Thanks
Martin


#4

Hello Martin,

I’ve added this to the get_run documentation, thanks for the suggestion!

Regards,
Tobias