Jenkins - Email-ext plugin display name of job in email

烈酒焚心 提交于 2021-01-28 19:01:51

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!