Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Endpoints to get the list of linked TestRail cases to a Jira ticket

Prachi Pandey
May 20, 2021

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.

3 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
James Woyciesjes
Contributor
March 11, 2026

@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:

image.pngimage.png

 

image.png

Evie Z_
Community Manager
Community Managers are Atlassian Team members who specifically run and moderate Atlassian communities. Feel free to say hello!
March 11, 2026

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!

0 votes
Karen Espolon
September 4, 2024

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

0 votes
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
May 21, 2021

Hi @Prachi Pandey 

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:

https://marketplace.atlassian.com/apps/1213701/testrail-integration-for-jira?hosting=cloud&tab=support


Best regards,

Bill

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events