What is scriptrunner equivalent to sys.exit() to exit script if condition is met.
Sample code flow to handle only if the ticket is related to vendor:
def a = issue.fields["customField_10111"]
if(a != "Vendor") {
sys.exit() //import sys is not available.
}
if( issue_fields["customField_10112"] == "Configuration") {
def result = put("/rest/api/2/issue/${issueKey}").header('Content-Type', 'application/json')
.body ([ fields: [
customField_10113: "Require Vendor Agreement"
] ]).asString()
def email = post("https://somewebhook.com/webhook1/" + ${issueKey)).asString()
}
if( something ) {
do something
}
Since it's Groovy you should be able to "exit" the code simply by using a "return" statement.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.