I want to get current Build user name into Active choice reactive parameter groovy script.
I have tried below code but its not working.
CodePudding user response:
Try the following:
try {
def user = hudson.model.User.current().getId()
return [user]
} catch (e)
{
return [e.toString()]
}
It is always better to use try and catch the exception in the groovy scripts, so as to figure out why it is not working.