Linking a newly created ticket with automation for Jira

I'm struggling how to use the link issues action in automation for Jira. I've setup a rule that when a specific issue type is created, it creates another of a different type. I want these two to be linked but can't get my head around how to do that...

Thanks!

1 answer

1 accepted

0 votes
Accepted answer
Andreas Knecht Community Champion Apr 25, 2017

Hi Saskia,

So your rule for this would have to look like this:

  • Trigger: Issue crated
  • JQL condition: type = Bug (or whatever issue type you have)
  • Action: Create issue
  • Action: Related issues with 'created issues' selected
    • On this related issues branch add the 'Link issues' action and select 'Trigger issue' as the issue you want to link to

So I think the trick here is the related issues condition to branch off for the newly created issue and then link that back to the issue that originally triggered the rule.  The issue on the main branch always refers to the trigger issue and not the created issue.  We've already got https://codebarrel.atlassian.net/browse/AUT-277 as well to make this particular case a bit easier!

Hope this helps!

Cheers,

  Andreas

I think I'm doing something wrong... It's still not linking them - have I missed something? Thanks!

Screenshot.png

 

Andreas Knecht Community Champion Apr 26, 2017

Hi Saskia,

That looks about right.  Is this a project specific rule though (you can see this in 'Rule details')?  Is the 'CONFIG' project different to the project this rule is defined in?

If that's the case, then you need to make this a global rule that can perform actions across different projects.

You can do so by visiting global admin -> system -> automation rules then edit the rule details and change this to be a global rule.

You'll probably want to add a JQL condition immediately after the trigger to check the created issue is in the current project (so project = 'ABC').

Hope this helps.

Cheers,

  Andreas

I made no changes and noticed this morning whilst someone else was creating a ticket it linked them... It works, not sure why it wasn't yesterday!

Thanks!

A related question... How do I refer to related issues? E.g. when referring to a parent issue it would {{issue.parent.fieldname}}.

Thanks!

Andreas Knecht Community Champion Apr 27, 2017

Hi Saskia,

Great the linking is now working.

For parent issue you should be able to use:

{{issue.parent.fields.summary}}

(to get the 'summary' for example)

Cheers,

  Andreas

Gotcha - didn't realize the parent parameter worked for related items too, assumed it was just child/parent relationship.

Will give that a go.

Thanks!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Oct 31, 2018 in Marketplace Apps

Marketplace Spotlight: Zephyr

Hello Atlassian Community! Each month, we run a series of Spotlights to highlight Marketplace vendors and apps that our team thinks this Community would find valuable. In last month's Spotlig...

354 views 0 1
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