Skip to content

Instantly share code, notes, and snippets.

@gwsu2008
Created May 28, 2020 21:47
Show Gist options
  • Save gwsu2008/5d077c73b686dd7fd8b2ab11f8508cd5 to your computer and use it in GitHub Desktop.
Save gwsu2008/5d077c73b686dd7fd8b2ab11f8508cd5 to your computer and use it in GitHub Desktop.
pipeline-get-userId.groovy
#NonCPS
def getBuildUser() {
return currentBuild.rawBuild.getCause(Cause.UserIdCause).getUserId()
}
@NonCPS
def getBuildUserName() {
return currentBuild.rawBuild.getCause(Cause.UserIdCause).getUserName()
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment