Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

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

0 votes

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

Online AMA this week: Your project management questions answered by Jira Design Lead James Rotanson

We know that great teams require amazing project management chops. It's no surprise that great teams who use Jira have strong project managers, effective workflows, and secrets that bring planning ...

184 views 1 6
Read article

Atlassian Community Events