Can I check if an issue has no issue links, or specific links with Automation for JIRA?

Andreas Knecht Community Champion Sep 13, 2016

I would like to check a condition where the issue being update has linked issues. In the case it doesn't, then automation can proceed to create the new issue.

1 answer

1 accepted

1 vote
Andreas Knecht Community Champion Sep 13, 2016

This is possible with the "Compare condition" already.

If you want to check that an issue has *no* issue links, you can do it like this:

{{#issue.fields.issuelinks}}{{id}}{{/issue.fields.issuelinks}}
Equals 
'empty' (just leave the field blank)

nolinks.png

This expression basically tries to loop through all issuelinks and prints out their ids if any exist. Checking for empty allows to check if there's no links basically.

 

You can also do more advanced stuff and check a specific issue link exists:

{{#issue.fields.issuelinks}}{{inwardIssue.key}}{{/issue.fields.issuelinks}}
Matches Regular Expression
.*TEST-6384.*

specificlink.png

This expression loops through all inward issuelinks (you can also loop through outward links) and prints out their keys if any exist. It then checks for a specific key using a regular expression match.

This is available in Automation for JIRA.  For a list of all available components please see http://codebarrel.io/available-rule-components.

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Jul 10, 2018 in Marketplace Apps

If you’re an Atlassian app developer, you’ll want to know about Atlas Camp!

This September 6-7, hundreds of Atlassian App developers will flock to Barcelona Spain to build skills, discover product roadmaps, meet face-to-face with the Atlassian team, and learn how to extend t...

172 views 0 4
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