Adding / duplicating subtasks (Automation for Jira)
Asked by Matthew Burrel:

Hi there!

Is it possible to block duplication of subtasks within the parent issue when changing its status backward / forward? Please have a look at the below;  

**When:** Issue Transitioned  
**From:** Draft  
**To:** In Review

**Then:** Create a new (sub-tasks)  
**In:** My_Project

However, once I get back from step "In Review" to "Draft" and then again from "Draft" to "In Review" - subtasks duplicate and arise again.

I hope that the solution is pretty easy for advanced users and I can count on your help. :)


Answers:
author: Stuart Capel - London
body: Hi [@Matthew Burrel](/t5/user/viewprofilepage/user-id/4216913)

If I've understood what you're looking for here then adding a condition like this should work for you:

![Capture.JPG](https://community.atlassian.com/t5/image/serverpage/image-id/124879i857EDA639A19322D/image-size/large?v=v2&px=999 "Capture.JPG")

comments: author: Matthew Burrel
body: Great - it works! Thanks for a swift reply :)

Cheers,  
M


author: Matthew Burrel
body: [@Stuart Capel - London](/t5/user/viewprofilepage/user-id/3684552)what if.. we have a previous transition with a sub-task creation and the second one I mentioned above? In this scenario, one auto-created sub-task in the first transition blocks creating another sub-task in the second one.

1st

![01.png](https://community.atlassian.com/t5/image/serverpage/image-id/125223iDFEE33AD32F959E2/image-dimensions/131x270?v=v2 "01.png")

2nd

![02.png](https://community.atlassian.com/t5/image/serverpage/image-id/125224iAC55FAB7D723C0E5/image-dimensions/205x345?v=v2 "02.png")

All in all, once we have auto-created sub-task between "TO DO" - "Draft" transition - Another sub-task in further "Draft" - "In Review" transition is not created. Any idea? :)

Cheers,

J


author: Stuart Capel - London
body: Hi [@Matthew Burrel](/t5/user/viewprofilepage/user-id/4216913)

I'm not completely clear on your question here. Do you mean why doesn't the automation create sub tasks when transitioning from 'Draft' to 'In Review' in 2nd?

Or are you asking if there's a way to stop duplicate sub tasks being created, only if the issue has already transitioned from Draft to interview once before?


author: Matthew Burrel
body: Hi [@Stuart Capel - London](/t5/user/viewprofilepage/user-id/3684552)  

Thank you very much for your commitment.  

Both, because previously by those 2 rules (When: Issue Transitioned) I auto-created subtask(s) per each step (1st step - From "To Do" to "Draft", 2nd step - From "Draft" to "In Review"). It worked nicely at that time. However, the first issue was raised when I start changing the mentioned statuses backward / forward - then subtask(s) duplications popped up. Then I got your advice to add in the rule "When:Issue Transitioned" from "Draft" to "In Review" this part - \> "If: Sub-tasks not present". I added this item in the second rule and now after creating subtask(s) in the 1st step (From "To Do" to "Draft") - the system stopped adding subtask(s) in the 2nd step.  

I hope that is clear right now and not so complicated as it seems. ;)  

Cheers,  
M


author: Matthew Burrel
body: [@Stuart Capel - London](/t5/user/viewprofilepage/user-id/3684552)any ideas? you are my last hope :)  

J


author: Stuart Capel - London
body: ? I had a look last night but I need work out the jql. Bare with me, I might have what you need ?


author: Matthew Burrel
body: Hi [@Stuart Capel - London](/t5/user/viewprofilepage/user-id/3684552) any chance to get an update here? I believe that you came up with some fresh ideas :)