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

TestRail REST API - get all tests / cases by References Keys


Hi there,
We doing some customization on Jira side I want to automatically link cases in the TestRail to the new Jira issue, which already have pack of links to the other Jira issues, which already have tests / cases …
From Jira side this is not a problem to take list of linked issues.
So, I have Issue Key, which means References field in Test Rail and I want to get all cases where it used in References field.

Any idea how to do this ?
Reading API doc’s doesn’t let me idea about this :confused:


Hi Andrii,

There’s currently no direct API for this but you could look into using the get_cases API and then filter the result on your side:

What you are trying to achieve sounds very similar to the functionality our plugin already provides. Have you already reviewed our plugin for JIRA?



Thanks for the answer.
We already use your plugin.
But, I checked Jira Data Storage & don’t see that this plugin store any information about links between Jira issue & test case in the Jira.
As I see & understood it just place iframe with issue key like
into the issue and all data is preparing at TestRail side.

More detail - we have some master issue which linked to the other issues in the Jira & I want to have test cases in this master issue too.
I can get issues by links through script runner groovy script, but how to get all test cases for those issues from Test Rail …
Seems I will take all and then parse it by my list of linked issues & then create new References to the master issue in those test cases …


Hi Andrii,

Yes, that’s correct and the TestRail for JIRA add-on do not store actual data in JIRA’s database (except for JIRA Server, but just some basic configuration settings) and the panels are embedded and rendered by TestRail instead. If you add the master issue to the References field in TestRail for the test cases, the cases would also appear on the master issue page. You can enter multiple issues per case or results by separating them by comma.

I hope this helps!



I was just going to ask about this as we assumed that the JIRA plugin must already be obtaining a list of test cases from TestRail via the Reference ID in order to present the linked tests in JIRA.

We plan on creating JIRA reports to do the test case traceability for a given project / board (so we don’t have to manually push in a list of requirements into TestRail for the existing traceability report), and to do this efficiently we would need to call some sort of get case by reference api.

Without the API we’d need to iterate through all TestRail projects, get all the cases, and then do the filtering from the report side, which would cost quite a lot of time.

TL;DR: Please expose an API that, given a Reference, returns the list of associated cases.


Hi Glenn,

Thanks for your feedback. If you have access to TestRail’s database, you can query the refs and defects tables (starting with TR 5.0) and this would be what you are looking for. There’s currently no dedicated API method for this but we are happy to look into this.



+ 1 for exposing the Refs API. Thanks.


Thanks for your feedback, James!



Hey guys!
We need the same feature: get or filter by references key test run/cases. We need this information for outer printable report so existing integration Jira-TestRais is not enought. Is there any chance that this ability already implemented or will be implemented in nearest future.


We would also really appreciate having this feature exposed via the API. We want to print a list of all jira issues (matching some criteria) that don’t have associated test cases.