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

API to get all run_ids in a Test Plan

Hi All,

I am new to TestRail. As part of a project requirement, we are automating test rail results update through our automation framework.

To get results into test rail we are using add_result_for_case POST API which uses unique case_id ans run_id.

Now we have multiple unique run_id values as our runs are defined inside a test plan (again with its own run_id).

Is there a way of using API or any algorithm to retrieve all the available run_ids in a test plan so that we can use it with the POST request mentioned above???

We are trying to do it programmatically, rather than putting in run_id values somewhere manually and use it with the api.

Looking forward for a solution.

Thanks in advance.


Hi Swapster,
I hope i got you right:

Check get_plan to retrieve all information for a test plan. The response contains information about all the entries with their runs. By this you should be able to find the run_id’s.

Additional comment:
Adding a result to a test is time consuming. Depending on your number of tests (and executions). If possible (depending on your logic) you should think about setting results at the final end of the run or in chunks.