I have set up auto-sub task creation using post functions on a transitions in our workflow. However, it works fine in creating auto sub-task when i use that transition. But i don't want them to be recreated if this process has to be repeated. I am using scriptrunner built in script for auto-creating subtask on transition.
I want to create a condition for avoiding the creation for the post function feature 'create subtask' if a subtask with the same summary already exists.
Thanks in advance,
Siva.
I got the Script here it is
I"ve added the below script into the create a sub-task post function code editor condition. You'd need to update 'manage onboarding' to be the relevant summary of the sub task that you don't want to re-create if the same summary exists.
import com.atlassian.jira.component.ComponentAccessor
def subtasks = issue.subTaskObjects
if(subtasks.find{it.summary == "Manage Onboarding"})
{
return false
}
else
{
return true
}
Hi @siva , how to change the condition to the issue type name instead of the summary of the sub-task?
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.