How to avoid Auto sub-task creation if subtask in parent with same summary already exists?

siva June 28, 2021

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.

1 answer

1 accepted

1 vote
Answer accepted
siva June 29, 2021

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

}

Paolo Cruz December 20, 2021

Hi @siva , how to change the condition to the issue type name instead of the summary of the sub-task?

Suggest an answer

Log in or Sign up to answer