Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

siva
Contributor
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
Contributor
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
TAGS
atlassian, jira cloud certification, managing jira projects, jira project administration, jira cloud exam, atlassian certification, agile project management, jira workflows, jira permissions, jira training, jira cloud skills, atlassian learning

Become a Certified Jira Service Project Expert 🦸🏻‍♂️

Validate your expertise in managing Jira Service Projects for Cloud. Master configuration, optimize workflows, and manage users seamlessly. Earn global 🗺️ recognition and advance your career as a trusted Jira Service management expert.

Get Certified! ✍️
AUG Leaders

Atlassian Community Events