Forum Discussion

erutan's avatar
erutan
Occasional Contributor
2 years ago
Solved

Test Cases API - How to add a link to an issue on a different project?

I’m using the test cases endpoint API to create test cases, and I would like to link the test cases to issues that are on a different project.

How can I do that?

While path parameters include testCaseKey which has the project id in the test case key - PRJ-T123, the body parameters include only issueId which is integer.

I can’t use the full issue key which includes project, e.g. PRJ2-1234, and I can't find the issue ID in an issue details page.

 

From docs :

Create issue link

Creates a link between a test case and a Jira issue.

AUTHORIZATIONS:

AccessToken

PATH PARAMETERS

testCaseKey - required - string(.+-T[0-9]+) - The key of the test case. Test case keys are of the format [A-Z]+-T[0-9]+

REQUEST BODY SCHEMA: application/json

Issue Link Input

issueId - required - integer <int64> >= 1 - The issue ID

  • As no one from the community answered this, I thought it's best to add the official Support answer:

     

    Zephyr Scales REST API uses the JIRA IDs and does not accept the keys.

     

    One can make use of Atlassian's Cloud REST API to obtain the IDs by using Jira keys.

    See the following documentation https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-get

     

    Then it's possible to use the Create issue links endpoint to create a link between a test case and a Jira issue of any project.

    See screenshot for example.

     

    So basically a script is needed if anyone wants to automate this, get IDs out of the issue key, then use the Create Issue Link endpoint to create the link between the test and the issue.

1 Reply

  • erutan's avatar
    erutan
    Occasional Contributor

    As no one from the community answered this, I thought it's best to add the official Support answer:

     

    Zephyr Scales REST API uses the JIRA IDs and does not accept the keys.

     

    One can make use of Atlassian's Cloud REST API to obtain the IDs by using Jira keys.

    See the following documentation https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issues/#api-rest-api-3-issue-issueidorkey-get

     

    Then it's possible to use the Create issue links endpoint to create a link between a test case and a Jira issue of any project.

    See screenshot for example.

     

    So basically a script is needed if anyone wants to automate this, get IDs out of the issue key, then use the Create Issue Link endpoint to create the link between the test and the issue.