Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira automation linking

Jimmy October 13, 2020

I have the following automation created:

If Issue 1 created then

Issue 2 created (linked to issue 1) AND

Issue 3 created (linked to issue 1)

Is it possible to configure the automation to link Issue 2 and Issue 3 as well?

Thanks,

1 answer

0 votes
Sam Harding
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 18, 2020

Hi,

You can link multiple issues when creating a new issue by using the 'More Options' drop down on the issue create component. Here, add a json payload with the issue links, following the style outlined here: https://support.atlassian.com/jira-software-cloud/docs/advanced-field-editing-json/

For you case, the Issue 2 can be referenced in smart values as {{createdIssue}}. So you json would look like:

{"update": {
        "issuelinks": [
            {
                "add": {
                    "type": {
                        "name": "Relates"
                    },
                    "outwardIssue": {
                        "key": "{{issue.key}}"
                    }
                },
"add": { "type": { "name": "Relates" }, "outwardIssue": { "key": "{{createdIssue.key}}" } } } ] } }

This would be the 'More Options' payload for your issue 3, where the first is the link to issue 1, and the second is the link to the issue 2. You can also change the type from "Relates" to whichever link type you want

Hope that helps,

Thanks

Orly Dahan
Contributor
February 1, 2023

Hi Sam,

I have a manual automation that creates 7 stories.

When the 3rd one is created, it needs to be linked to the previous 2 with "is blocked by".

I tried to use the code that you suggested (used 'Create variable' for the keys of the 2 issues), but for some reason, only the last one is linked.

What am I missing?

PrintS1.png

Suggest an answer

Log in or Sign up to answer