Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Added example of how to use this plugin with the pipeline, this was based on this SO post (https://stackoverflow.com/questions/35902664/get-username-logged-in-jenkins-from-jenkins-workflow-pipeline-plugin#35902865) . It worked for me.
Wiki Markup
{jenkins-plugin-info:pluginId=build-user-vars-plugin|jiraComponent=build-user-vars-plugin}
Excerpt

This plugin provides a set of environment variables that describe the user who started the build.

Variables provided

This plugin defines the following environment variables to describe the user who started the build:

Variable

Description

BUILD_USER

Full name (first name + last name)

BUILD_USER_FIRST_NAME

First name

BUILD_USER_LAST_NAME

Last name

BUILD_USER_ID

Jenkins user ID

BUILD_USER_EMAIL

Email address

Usage example

Select Set Jenkins user build variables and reference the variables during the build:

Pipeline Examples

Code Block
languagegroovy
titleScript
linenumberstrue
collapsetrue
node {
  wrap([$class: 'BuildUser']) {
    def user = env.BUILD_USER_ID
  }
}


Jenkins core compatibility

...