How to use Build User Vars Plugin with Pipeline? Bee Bot July 13, 2022 11:45 Updated The content of this article has moved to the new documentation site. Related articles Pipeline - Build failed due to MissingPropertyException: No such property: env How to access Changelogs in a Pipeline Job? How to embed html report in email body using Email-ext plugin? Groovy to list all jobs How to troubleshoot 'hudson.FilePath is missing' in a Pipeline run Comments 3 comments Sort by Date Votes Nachoyo89 Nachoyo89 May 31, 2017 15:24 Edited I tried this on multibranch pipeline and it doesn't work. stage('stage1') { steps { wrap([$class: 'BuildUser']) { sh 'echo "${BUILD_USER}"' sh 'echo "${BUILD_USER_ID}"' sh 'echo "${BUILD_USER_EMAIL}"' }} I am using version 1.5 of Build User Vars Plugin 1 Joe Tavin August 22, 2017 08:09 Try without invoking sh, just echo direct like so: stage('stage1') { steps { wrap([$class: 'BuildUser']) { echo "${BUILD_USER}" echo "${BUILD_USER_ID}" echo "${BUILD_USER_EMAIL}" }} -2 Denis Chekhlov March 07, 2018 13:32 https://stackoverflow.com/questions/35902664/get-user-name-from-jenkins-workflow-pipeline-plugin/48649228#48649228``` pipeline { agent any stages { stage('build user') { steps { wrap([$class: 'BuildUser']) { sh 'echo "${BUILD_USER}"' } } } } }``` WORKS! 1 Please sign in to leave a comment.
Comments
3 comments
I tried this on multibranch pipeline and it doesn't work.
I am using version 1.5 of Build User Vars Plugin
Try without invoking sh, just echo direct like so:
https://stackoverflow.com/questions/35902664/get-user-name-from-jenkins-workflow-pipeline-plugin/48649228#48649228
```
WORKS!
Please sign in to leave a comment.