Created
May 28, 2020 21:47
-
-
Save gwsu2008/5d077c73b686dd7fd8b2ab11f8508cd5 to your computer and use it in GitHub Desktop.
pipeline-get-userId.groovy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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