Can I link issues with Automation for JIRA when I create a new issue?

Andreas Knecht Community Champion Sep 13, 2016

What would I write in the Advanced section if I wanted to create links? 

For example: 

When issue X has a certain update, create issue Y and link them. 

Issue X relates to Issue Y.

thanks!

5 answers

1 accepted

This widget could not be displayed.

So there's two ways to achieve this.  The easiest way is to simply add the "Linked issues" field to your create issue action like this and link to the 'Trigger issue':

link-created.png

This requires that the linked issues field is on your create issue screen though!

 

You can also achieve this with the separate 'Link issue' action but it requires branching off (using the 'Branch rule / Related issues action') for the created issue:

link-related-created.png

One caveat with this approach is that if this is a project specific rule (which you can see in 'Rule details') and the created issue is another project then this wont work.  You'll have to change this rule to a 'Global' rule via the 'Automation rules' section in global admin first so that the 'related issues' branch action can find the created issue in a different project.

Find out more about Automation for JIRA on marketplace, or visit our component docs: http://codebarrel.io/available-rule-components

I tried this but am getting an error in the automation log.

 

  Error creating issue
No issue link type with name 'relates to' found.

 

The type of link I want to do is "relates to" and linking is available on the create issue screen. I made a minor change to the code to reflect that:

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

 

 

Screen Shot 2016-09-14 at 8.59.31 AM.png

 

 

TIA!

I figured it out, after some coffee and chocolate smile

Our issue link type is called Related.

 

Andreas Knecht Community Champion Sep 14, 2016

Hi Phyllis, 

Glad to hear you worked it out. Many things are solved with coffee and chocolate (only dark chocolate though I hope smile)!

Yes I should have made that more clear in my answer.  To get the issue link name, you need to check what they are called in your instance by visiting https://<yourinstance>/secure/admin/ViewLinkTypes!default.jspa (if you are a global admin).

Cheers,
  Andreas 

This widget could not be displayed.

You should add this little statement from the blog to all your documentation: 

Just make sure the “Link issues” field is on the appropriate screen in JIRA!

This was causing me havoc till I finally found this.

I have the "linked issues" field in the Create issues screen.  I have a rule set up to trigger once a story is created in a specific project to a specific Scrum Team....then Create a task...then link the task to the trigger issue.  Everything works up to the creation of the new task...but the new task will not link to the parent.

Basically once a story is created under specified conditions

new task is generated

and a link "Child of" is set to Trigger issue.

 

This doesn't seem to work.  Any suggestions??

Andreas Knecht Community Champion Apr 26, 2017

Hey Brett,

Can you raise a support request please at https://codebarrel.io/support and include screenshots of your rule configuration and audit log (with show more expanded) please?

Cheers,

  Andreas

 

This widget could not be displayed.

Hi Andreas,.

Is there a guarantee that the trigger issue is available in scope via smart values, e.g., {{triggerIssue.fields.MyCustomTextField}}? I am having troubles squeezing any sort of info from the issue triggering the rule once I find myself deep down covered under a branch rule like "For all linked issues". The values there, for both {{triggerIssue}} and {{triggerIssue.fields.MyCustomTextField}} are null (empty string if tried to be dereferenced in, say, Description or Assignee box). 

Andreas Knecht Community Champion Aug 28, 2017

Hi Arici,

 

That should definitely work. 'triggerIssue' is always defined to be the issue introduced by the rule trigger.

Can you raise a support request please at: https://codebarrel.io/support

Please include a screenshot of your rule configuration and audit log showing a rule execution.

Cheers,

  Andreas

This widget could not be displayed.

the rule in the picture produces, for a non-null triggerIssue and a non-empty Driver (user picker) the following description:

RulareTeste pt: 
TESTS IN PROGRESS status instrumentat de un child- (=belongs-to) task in Daily. 
and triggerissue is

and triggerissue.fields.driver e:

triggerIssue info needed.JPG

 

Any help is appreciated, thanks!

Pompi

Hi Pompi,


Looking at your screenshot, it looks like you are using 'triggerissue'.  This is case sensitive though. It needs to be:

triggerIssue

Hope that helps.  Also to set a user field like 'Tester', you'll need:

{{triggerIssue.fields.Tester.name}}

 

Cheers,

  Andreas

That workded like a charm. Thank you. (it would be nice to have it emphasized that curly language , at least as variable names goes, is in fact case sensitive. I was under the impression , after reading the couple doc pages, taht smart fields are case insensitive - could be just my lack of attention though). Thanks again for the prompt response.

This widget could not be displayed.

Hi, I think I have a similar problem. When an Issue's status is changed to Done I use Automation to Clone the Issue and transition it to Backlog. However I need all the Sub-Tasks of the Issue to also be cloned and transitioned to Backlog. How would you set up this rule?

 

Clone Issue > Transition to Backlog > Branch: Subtasks > Link Issue??

 

So far I keep ending up with two clones of the parent issue in Backlog of trigger issue and no sub-tasks.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Aug 22, 2018 in Marketplace Apps

How a Marketplace app tech team is achieving gender diversity

Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...

484 views 3 18
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you