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
source share