Hi,
I’ve set up Jira automation to create three sub-tasks (Sub-task 1, 2, and 3) when the issue transitions from Sizing → On Deck. However, if the status moves back to Sizing and then again to On Deck, the same sub-tasks are recreated.
How can I configure the automation to prevent duplicate sub-tasks from being added if they already exist?
Thanks!
Hi,
I had to do something similar to a twilio x jira itsm connection I did earlier this year, because it would create the same subtask when they would get disconnected, but anyways try this:
Trigger
Issue transitioned → From: Sizing → To: On Deck
(Optional) Re-fetch issue data
Lookup existing sub-tasks
Lookup issues with JQL:
issuetype = Sub-task AND parent = {{issue.key}} AND (summary = "Sub-task 1" OR summary = "Sub-task 2" OR summary = "Sub-task 3")
Create only what’s missing
Use three separate IF blocks so you can create more than one in the same run.
IF {{lookupIssues.summary}}
does not contain Sub-task 1
→ Create issue (Sub-task) → Summary: Sub-task 1
IF {{lookupIssues.summary}}
does not contain Sub-task 2
→ Create issue (Sub-task) → Summary: Sub-task 2
IF {{lookupIssues.summary}}
does not contain Sub-task 3
→ Create issue (Sub-task) → Summary: Sub-task 3
Labels are you best friend!!!
If titles might change, tag created sub-tasks and check for the tag instead of the summary text.
When creating each sub-task, set Labels: auto-created
Before each creation, add Related issues condition → Sub-tasks → None match JQL:
labels = auto-created AND summary = "Sub-task 1"
Result: Re-entering On Deck won’t duplicate existing sub-tasks; the rule only adds whichever ones are missing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.