I want to write an Automation rule that only adds sub-tasks if that sub-task doesn't exist yet on an issue. Is this possible with Automation for JIRA?
Once again the compare condition (see all our rule components) can help here with smart-values:
Project automation - Code Barrel JIRA 2016-09-21 10-16-13.png
So this rule uses the compare condition to create a string out of all existing subtask summaries. If no subtasks exist yet, then it will simply be the empty string. However otherwise it will concatenate all existing subtask summaries separated by a space character. We then check using a regular expression if this string contains the subtask summary of the new subtask we want to create yet ("my awesome subtask") in this case.
Only if the existing subtask summaries don't match this string yet (i.e. it doesn't exist), will the rule continue and create our 1 sub-task with the summary "my awesome subtask".
The extra space inside this smart-value completion is important (it separates the subtask summaries by a space if there's multiple subtasks):
{{#issue.fields.subtasks}}{{fields.summary}} {{/issue.fields.subtasks}}
You can also compare other sub-task attributes, by using something other than fields.summary
in the example above. For example: fields.priority.name
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
How can I check if an issue already exists in an epic?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This works if the trigger issue is not an epic and has an epic link.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for this answer as it worked like a champ for my use case!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi I am new to Jira automation and this forum. So please forgive me.
re
{{#issue.fields.subtasks}}{{fields.summary}} {{/issue.fields.subtasks}}
Can you show how you have used this in an example please. My first delve into adding Automation to our Jira is to have approval and estimation tickets created. I am using the transition to review as trigger. I wan to ensure that if the status is reset, that the tasks are not created again.
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.