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.
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.
I also try to improve the rule. However, I'd like to pass in a dynamic value, not a static one (like TEST-6384 in this example). So I would need to create a variable out of the first found issue key in the comment body. How can I do that? Or is there a way to check again for that exact issue key found in the comment body?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.