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

How to link a newly created testrun with an existing suite using java code


I have created a new testplan and I createda new testrun inside the same testplan . Now I want to link this testrun with an already existing suite/testcase . can I achieve that in my automation code?


Hi Vatsal,

Thanks for your post! You can use the TestRail API’s update_plan_entry method to update the run in the plan and set the test case selection if needed:

That said, this wouldn’t allow you to change the test suite associated to the run as this would be determined upon creation of the test run within the test plan. The update_plan_entry method wouldn’t support the suite_id POST request field, and you can see the full list of supported request fields from the link I provided above.

Hope this helps!