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

How to get Test case ids for a specific run (with selected cases)



We are implementing a customization to manually trigger a jenkins job to execute automation through Testrail interface (in run/view). In order to execute the automation, we need to pass the tag assigned to each test case.
Our automation framework is using Cucumber, so we added a custom field for each test cases referencing this tag (example : @tag-123).

Is there a way with Testrail API to get the ids of test cases that are selected in a run?
Making get_cases allows me to get the suite_id, and making get_run allows me to get also the suite_id, but I haven’t found a way to filter by selection of test cases for the run.

Thanks for your answer.


Hello Maxime,

Thanks for your posting. Yes, you can use get_tests in this case:

This returns the tests for a run and this also includes the case IDs and additional case related fields (including your custom field).

I hope this helps!



Great! Thank you very much.


You are welcome, Maxime!