Jenkins Editable Email Notification Templates

喜夏-厌秋 提交于 2020-01-17 06:30:31

问题


we have configured Jenkins - Editable Email Notification Templates for sending customized email after every build.

What we did:

  1. Added script under *Jenkins -> Manage Jenkins -> Editable Email Notification Templates-> Add New Template* and then under "Default Content" section, we added default groovy scripts (for example: groovy-html.template - Copy paste content). Save.
  2. Now under project job, under Post-build section we selected same template
  3. But when we receive emails, then email is coming without replacing environment variables.. like
 " />     BUILD ${build.result} URL   ${rooturl}${build.url}

Project:  ${project.name} Date:   ${it.timestampString} Duration: ${build.durationString} Cause:  ${cause.shortDescription}

Problem: Environment variable like "build.result", "build.url" etc are coming as variable name (instead of actual values). Are we missing something here?


回答1:


Got the solution:) We need to specify into Default Content section as ${JELLY_SCRIPT,template="Jelly script name"} and place script under JENKINS home "email-templates" folder



来源:https://stackoverflow.com/questions/43936651/jenkins-editable-email-notification-templates

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