I have several subtasks that are created on transition, but occasionally the parent issue will be moved to a previous status and then back. This causes the subtask to be created again. I am trying to create a condition in the post function to prevent execution if there is already a subtask of that type present. I've seen solutions for Scruptrunner for JIRA server but am in search of a solution for Scriptrunner for cloud.
Thank you for your question.
So that i am able to advise further on on your requirement, can I please confirm how are you creating the subtasks, are you using the *Create Subtask* workflow function provided by ScriptRunner for Jira Cloud or have you created your own script to create the subtaks?
Thank you for this.
I can confirm that the way to achieve this would be to set a field on the parent issues such as a checkbox on the subtask when it is created.
You would then be able to condition to the *Create Subtask* function in order to check if the checkbox value was set and only to create the subtask when the value was not set.
I can confirm that we have examples of how to extract and set different types of fields in the documentation pages here and we have details of how to create conditions for the post function in the documentation page here and that you will be able to use these as reference guides to help you achieve your requirement.
I hope this helps.
Project managers know this problem: A “mountain of work” lays in front of you, and you don’t know how and where to tackle them. Different to-dos lie ahead, but just one task after the other can be ha...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events