How to get the BUILD_USER in Jenkins when job triggered by timer?

后端 未结 14 1621
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-12-09 03:01

I wanted to show the user who triggered a Jenkins job in the post job email. This is possible by using the plugin Build User Vars Plugin and the env variable

14条回答
  •  北荒
    北荒 (楼主)
    2020-12-09 03:29

    The token $BUILD_CAUSE from the email-ext plugin is what you are looking for.

    You can see the full content token reference when you click the ? just after the Attach build log combobox at the email content configuration.

    Some tokens get added by plugins, but this one should be aviable by default.

    Edit: As pointed out by bishop in the comments, when using the EnvInject plugin, the $BUILD_CAUSE token gets changed to behave differently.

提交回复
热议问题