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

How can I use custom case selection instead of include_all = true in api

I am trying to use API to migrate test results inside a test plan from one testrail instance to another. The old testrail instance has testruns with custom sections of the testsuite it was created for. When I am migrating them in new instance with /add_plan_entry api documented in http://docs.gurock.com/testrail-api2/reference-plans#add_plan_entry, it is copying all the sections. How can I get only the custom ones which are specifically defined in the old one?

Also, how can I copy the actual test results to this testrun using API? I get a message about testrun cannot be updated because it is a part of a testplan.

Hi Abha,

Thanks for the post! When creating a test plan entry using the API, you can define the runs inside the plan entry using the config_ids and runs fields, as outlined in our documentation here. For each test run inside the entry, you can use theinclude_all and case_ids fields to specify the test cases to use inside the entry.

When adding results to these runs, the error message you described would indicate you are trying to update the runs instead of adding results. To migrate the test results, you would use the add_results or add_results_for_cases endpoints to submit your results.

Hope this helps,
Jon