Home > Mobile >  How to get current Build_user in parameterized jenkins project
How to get current Build_user in parameterized jenkins project

Time:11-28

I want to get current Build user name into Active choice reactive parameter groovy script.

I have tried below code but its not working.

my project is parameterized.

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.

  • Related