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

API: TestPlan-Run-Entry: reading existing cases and adding new ones on the fly


#1

hi
we started using Testrail and I’m integrating it with out automation system.

what I want to do is, for each regression run, create a test-pan, add a run to it, open a new entry and start running and for each test I’m executing I want to add its ID to the entry’s ‘case_ids’ list.

I’ve tried doing so with ‘update_plan_entry’ but I’ve noticed that it replaces the elements in the list with the new ones I’ve provided rather than adding them…

so, if I have cases [1, 2, 3, 4] and I update with cases [5, 6, 7] I’ll have [5, 6, 7] instead of [1, 2, 3, 4, 5, 6, 7]…

I also tried to read all existing cases assigned to the entry so I’ll be able to bypass it by specify the full list explicitly in the ‘update_plan_entry’ but I couldn’t find how do I get this info…

please advise.


#2

Have you tried using ‘add_plan_entry’?


#3

Thank you for your reply.

Actually I have but it is not updating the existing entry but open a new one in addition to it… also the description in the tutorial specify explicitly that it adds a new entry…

from the manual it seem that the best method to be used is the ‘update_plan_entry’ method but - as I wrote in my original message, it is not working the way I want it to…


#4

Hi @ihovav,

Updating the case selection always sets the full case selection and not just adds the cases. You can find out the current selection by calling get_tests/:run_id and the case IDs are included in the result.

I hope this helps!

Cheers,
Tobias