You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
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:
try{
def newSubtask created = issueManager.createIssueObject(user,newparams)
}
catch(exception e){
//dosomething
}
if(newSubtask){
//delete the initial request ticket
}
Those are some examples, you may can change the script logic based on your desired requirement.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.