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

Missing RunID with get_plan


Hi All,

I have a python script that is happily getting the RunIds (from the entries array returned by the ‘get_plan’ api) for a given PlanId. It is returning 4 run IDs. All ok so far…

Last week I added a new suite to this plan. The expected test runs are shown in testrail (for that plan) but I’m not seeing the RunId for the new test run when using the API.

It is still returning the RunIds for the 4 original runs.

Any ideas what I’m doing wrong? (I suspect its because the new tests are from a different suite, but reading the API docs it doesn’t look like that makes a difference to get_plan - “entries array An array of ‘entries’, i.e. group of test runs”).

I’m using the v2 API, testrail python binding and TestRail v5.3.0.3603.


Hi Mark,

Thanks for your post! The get_plan method would always include all suites and runs that belong to the plan. Suites would be listed as ‘entries’, and configurations/runs would be listed in the ‘runs’ field of the entry. You would get a separate entry for each ‘suite’ added to the test plan if you’re using a test case repository with multiple test suites. The get_plan method doesn’t have any filters that would exclude a specific entry from the response, so perhaps this is just cached or you are querying the incorrect plan ID. Hope this helps!



Thanks for the reply Marco,

The idea that it might be caching somewhere made me look at the whole json response (something I should have done sooner). There were two entries and the run ID for the newly added suite tests were there, but I wasn’t seeing them in the python output so I figured the error was in my code.

It was a rookie mistake. I had the return from the python function indented too far so it was returning only the first ‘entry’. It was just blind luck that it was working ok as it was!

Fixing the indent returned the missing ID.

I hope I didn’t waste too much of your time, but I do appreciate that you pointed me in the right direction.




Hi Mark,

Thanks for the update, glad to hear you got it working! Just let us know if you run into any other issues and we’ll do our best to help out!