We have multiple Jira sites in our company, each one has its own purposes. Is there a way to link issues together between these sites using the REST API.
This is our scenario
https://domain.mycompany.com/jira01/browse/PROJ-123
https://domain.mycompany.com/jira02/browse/QA-510.
Now I would like to use the REST API to link these two issues together VIA REST API.
Thanks a lot.
Hi @Taiseer Hussein,
It seems there is no REST API endpoint for such a request.
However, you can accomplish the PROJ-123 >> More >> Link >> Jira Issue by following the steps below:
Application Link ID
Find out what is the Application Link ID your current source Jira instance (jira01) will be communicating to (jira02). To do it so:
As a response, you should find jira02 information:
{
"list": [
{
"application": {
"id": "5b8f5fb7-bf2a-3200-aa94-82793ffda887",
"typeId": "jira",
"name": "jira02",
"displayUrl": "https://domain.mycompany.com/jira02",
...
"rpcUrl": "https://domain.mycompany.com/jira02",
Take note of the "id" value, in the example above 5b8f5fb7-bf2a-3200-aa94-82793ffda887.
Issue ID
Find out the Jira issue ID from jira01
You can do that by hitting the following URL from you web browser https://domain.mycompany.com/jira01/rest/api/2/issue/PROJ-123
It will be the first "id" in response from endpoint above (in my example, 10100)
Creating Related to issue link
Now that you have gathered the necessary information build the payload, let's review what the payload is about:
inline=true
id=10100
jiraAppId=9f2d636e-c842-3388-8a66-17c1b951dd45
linkDesc=relates+to
issueKeys=QA-510
createReciprocal=true
comment=testing+relates+to+link
commentLevel=
Above is what you will be passing to the endpoint:
And you should be consuming the following endpoint https://domain.mycompany.com/jira01/secure/LinkJiraIssue.jspa
The cURL command would be:
curl -k -u USERNAME_A \
-H 'Content-Type: application/x-www-form-urlencoded; charset=UTF-8' \
-H 'X-Atlassian-Token: no-check' \
-H 'X-AUSERNAME: USERNAME_B' \
--data 'inline=true&id=10100&jiraAppId=5b8f5fb7-bf2a-3200-aa94-82793ffda887&linkDesc=relates+to&issueKeys=QA-510&createReciprocal=true&comment=testing+relates+to+link&commentLevel=' --compressed \
-X POST 'https://domain.mycompany.com/jira01/secure/LinkJiraIssue.jspa'
Hope the above helps.
Kind regards,
Rafael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.