Jira API issueLink connects two different instances

So, I have two different instances of Jira (let it be A and B), but they are related to each other.

I can create a link manually in a problem inside A, indicating a problem in instance B. Therefore, I can track problems from other instances. But how do I do this with the API?

If there is one instance, I will use this: https://docs.atlassian.com/jira/REST/latest/#d2e5606

Is there a way to determine where it should put the problem "out"?

As an addition - I do not want to use remoteLink, since it is not the same (this is just a crude link, and I need a real "connection" with changing statuses).

UPDATE

I added an answer, for example, a bash script can be seen there

+5
source share
1 answer

I have found the answer.

1) We make a request to the jira problem that we are going to connect (endpoint is / rest / api / latest / issue / $ {JIRA_ISSUE})

curl -D- -u ${JIRA_U}:${JIRA_P} -X GET -H "Content-Type: application/json" -m 60 ${JIRA_SOURCE_LINK} 

And extracting the id field. This is the internal identifier of the problem in jira "A"

2) Now we need to send a remote link to jira B '(/ rest / api / latest / issue / $ {JIRA_ISSUE} / remote endpoint), knowing what appjd jira A is and what is the internal question number (1) with type "com.atlassian.jira", see "globalId's" "issueId":

 { "globalId": "appId=0000-0000-000-000-000&issueId=101", "application": { "type": "com.atlassian.jira", "name": "Jira name" }, "relationship": "relates to", "object": { "url": "https://jiraurl/browse/ISSUE-11", "title": "ISSUE-11", "icon": {}, "status": { "icon": {} } } 

}

We will have this as: curl -D- -u ${JIRA_U}:${JIRA_P} -X POST -d '${JSON_TO_POST}' -H "Content-Type: application/json" -m 60 ${JIRA_LINK}

And everything is done.

UPDATE

Bash script example https://github.com/fat-troll/snippets/blob/master/jira_2_instance_crosspost.sh

+2
source

All Articles