Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

automatically delete a request ticket after subtask ticket is created on new parent.

I have a script that sets a creates a subtask ticket to one of 20 different parent tickets. If this succeeds i end up with a subtask ticket and the initial request ticket. How do i script a way to delete the initial request ticket if the subtask create succeeds and then have the script fail out if a subtask is not created?

1 answer

Hi @Alex Sprague 

It would be great we can see the whole script and which scriptrunner feature that execute the script.

If you are using issueManager.createIssueObject method to create the subtask issue, you can return an Issue object if successful or else its returned null or exception:


def newSubtask created = issueManager.createIssueObject(user,newparams)

catch(exception e){



//delete the initial request ticket

Those are some examples, you may can change the script logic based on your desired requirement.  

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira Service Management

Security Advisory for Jira Service Management

On October 20, 2021, Atlassian published a security advisory for Jira Service Management. The full advisory is available at this link.  We've seen a number of questions already asking for...

75 views 0 1
Read article

Community Events

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

Events near you