Hi,
I wanted to know if there are specific endpoints to get a list of linked TestRail cases using Jira API.
Goal is to get the list of test rail test cases associated with a Jira ticket.
Community moderators have prevented the ability to post new answers.
@Prachi Pandey , @Karen Espolon
If you are still looking for a solution...I have not created the final result yet but this may work by running two steps and bouncing the data against each other to get info for a dashboard. Note, this is based on Jira Cloud and I am just making calls in the browser, not programmatic yet..
Step 1: TestRail data:
Use the TestRail API to get the list of Test Cases in a given TestRail project that reference Jira issues (have refs):
https://yoursite.testrail.net/index.php?/api/v2/get_cases/entertestrailprojectidhere&suite_id=entertestrailsuiteidhere&limit=250&offset=0
Max return is 250 - iterate using offset=0,250,500,... until no more results.
Step 2: Jira data:
https://yoursite.atlassian.net/rest/api/3/search/jql?jql=project%20%3D%20yourprojectkeyhere%20AND%20issuetype%20%3D%20Feature%20AND%20statusCategory%20%21%3D%20Done&fields=key,summary,status&maxResults=100
This uses JQL to set the search parameters. In this case, I limited it to Features with statusCategory != Done. You can add additional fields to retrieve the data but I only want to see Test Case coverage for features so don't need additional fields.
Max return is 100, iterate using the "nextPageToken". If present, the nextPageToken will be at the bottom of your results. To do this, add it after the list of fields...
...&fields=key,summary,status&nextPageToken=pastenextpagetokenhere&maxResults=100
You need to grab the token at the bottom of each set of results and continue until no more results.
Step 3: Combine results:
I have not done this yet but my next step is to make a list of the Jira keys and look them up in the TestRail data to find which have Test Cases and which don't. This will let me know my coverage.
I will probably have a Forge macro created to do this and display the data in Confluence.
Assuming that works I will update here. In the meantime, for a very manual effort this would get to the end result
TestRail and Jira Cloud JSON snapshots and nextPageToken snapshot:
This topic is now closed as the discussion has become outdated. If you have more questions or want to continue the conversation, feel free to start a new topic. For more details on why we close older threads, check out our Rules of engagement - Atlassian Community .
Thank you for your understanding!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello, is there a workaround to meet this requirement? I also need to query JIRA ID and the linked test cases in order to build an RTM in JIRA.
Thanks,
Karen
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I doubt that is possible from the Jira REST API as Test Rail is a marketplace addon product, with its own API. Please consider contacting that vendor's support directly for the information:
Best regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Community moderators have prevented the ability to post new answers.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.