问题
Is there an easy way to include the display name of the job in the email subject?
Maybe there is an environment variable for this?
I know it should be possible because the default functionality (email notification) in jenkins already provides this information in the email subject.
回答1:
Yes, You can use the built-in environment JOB_NAME
, other available environments you can use are like BUILD_STATUS
, BUILD_NUMBER
, etc.
[${BUILD_STATUS}]${JOB_NAME} Build #${BUILD_NUMBER}
As always, you can go to http://your-jenkins-host/env-vars.html/ to get more built-in environments.
回答2:
The correct environemnt variable which I was looking for is
$BUILD_DISPLAY_NAME
The display name of the current build, which is something like "#153" by default.
Thanks at @maniframer to provide the link for getting more built-in environments.
来源:https://stackoverflow.com/questions/36772347/jenkins-email-ext-plugin-display-name-of-job-in-email