I need to exit from the scriptrunner script once the condition is matched.
if (!cnList) {
log.error("user already exist")
def reporter ="My comments"
//return commentMgr.getLastComment(issue)*.body
return commentMgr.create(issue,currentUser, "Error :: User $cFieldValue2 Onqid not found in LDAP. Please check the ONQid" , true)
return 0;
}
This piece of code is not working properly and iterating to the end of all functions.
I want to exit from the script once this condition is found please. A help will really be approtiated.
It's never going to reach your "return 0". The line above it already returns from the script no matter what, so it's stopping there.
Thanks for pointing that out. This also not exiting from function.
Do i need to return some other variable ?
if (!cnList) {
log.error("user already exist")
def reporter ="My comments"
//return commentMgr.getLastComment(issue)*.body
return 0
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, that absolutely is "exiting from function", so I think I need more information. Specifically:
What do you think "exiting from function" is? I don't think I am thinking it is the same thing as you, so I'd like to check. (To me, it means "stop on this line, execute no code past it, and hand back control to the function calling the script, saying 'I'm finished' to it")
What is this script trying to do?
Where is it running?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Below is the function i am using.
def user_jira_creation()
{ }
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.