Create and link work items between different Jira Cloud sites
Platform Notice: Cloud Only - This article only applies to Atlassian apps on the cloud platform.
Summary
Currently, you can connect two separate Jira Cloud sites using application links (app links), allowing you to link existing work items between the sites.
Solution
Sample automation rule steps
Step 1
Make use of any automation trigger. In the example below, we will use the manual trigger.
Step 2
We will utilize the “Send web request” action. This step requires careful configuration using the following parameters:
Create an API token for your site that will be used within the automation
Web request URL
{{baseUrl}}/rest/api/3/issue
Headers
Accept: application/json
Authorization: Basic <base64-token>
Remember to replace <base64-token> by your generated base64 encoded string at the 1st step from this post.
HTTP Method
POST
Web request body
Custom data
{
"fields": {
"project": { "key": "AP" },
"summary": "{{issue.summary}}",
"description": {
"type": "doc",
"version": 1,
"content": [
{
"type": "paragraph",
"content": [
{
"type": "text",
"text": "{{issue.description}}"
}
]
}
]
},
"issuetype": { "name": "Task" }
}
}
And make sure to check the "Delay execution of subsequent rule actions until we've received a response for this web request" checkbox.
Step 3
Add a log action and add the web response smart value to check which work item got created on the destination site.
{{webResponse.body.key}}
Step 4
Add a send web request action again to use the send web request action and make use of the endpoint shared below, and the custom data to create the link between both work items.
Payload (body)
{
"application": {
"name": "Application Link Name",
"type": "com.atlassian.jira"
},
"relationship": "is blocked by",
"object": {
"summary":"{{issue.summary}}",
"title": "{{issue.key}}",
"url": "https://{{url}}.atlassian.net/browse/{{issuekey}}"
},
"createReciprocalLink": true,
"globalId": "appId={{appID}}&issueId={{issueID}}"
}To get the APP ID of the destination site, make use of the below API call and check from the browser to get the APP ID eg: ( FP-18 is a work item).
https://<myinstance.atlassian.net/rest/api/3/issue/FP-18/remotelink>
Before performing the above step, make sure the manual link is working by using the app link; if not, we might not be able to get the APP ID.
Was this helpful?