How to find all Zephyr test cases linked to a Jira ticket key via Rest API

M Bleyer June 24, 2024

Given I have a Jira ticket key (e.g. "PROJECTNAME-1234"), how can I find all Zephyr test case items that are linked to this ticket, e.g. via traceability tab in Zephyr plugin, by using a Rest API call?

What I am currently using is

/rest/tests/1.0/testrun/search?fields=id,key,name,folderId&query=testRun.projectId+IN+(12345)+AND+testRun.folderTreeId+IN+(654321)+AND+testRun.keyName+LIKE+"FINDME"+ORDER+BY+testRun.name+ASC&maxResults=40&startAt=0&archived=false

but there is no parameter option for the Jira ticket key (if any) that is linked - does such a parameter exist?

2 answers

1 accepted

0 votes
Answer accepted
M Bleyer July 8, 2024

I reverse engineered it, essentially it can be done with

 

/rest/tests/1.0/testrun/search?fields=id%2Ckey%2Cname%2CfolderId%2CiterationId%2CprojectVersionId%2CenvironmentId%2CenvironmentIds%2CtestCaseCount%2CissueCount%2CcustomFieldValues%2CcreatedOn%2CissueId&query=testRun.projectId%20IN%20%2812345%29%20AND%20testRun.folderTreeId%20IN%20%28123454%29%20ORDER%20BY%20testRun.createdOn%20DESC&startAt=0&maxResults=40&archived=false
0 votes
Gip June 25, 2024

Hi @M Bleyer - Which Zephyr product (Squad, Scale or Enterprise) are you using with your Jira DC? And is this a Cloud or Server instance?

M Bleyer June 27, 2024

Jira server v9.12.8
Zephyr Scale

Suggest an answer

Log in or Sign up to answer