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?
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)
//delete the initial request ticket
Those are some examples, you may can change the script logic based on your desired requirement.
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...
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