扩展电子邮件通知的“默认内容”,如下设置和默认的内容类型发送常规代码是“HTML(text/html的)”:詹金斯电子邮件分机插件在电子邮件正文
<html>
<body>
<%
if(build.testResultAction) {
def testResult = build.testResultAction
def testCount = String.format("%.2f",(testResult.totalCount))
def testPassed = String.format("%.2f",())
def testFailed = String.format("%.2f",(testResult.result.failCount))
def testSkipped = String.format("%.2f",())
def buildDuration = String.format("%.2f",(testResult.result.duration))
}
%>
Hi All,<br><br>
The execution of the Automation suite has been completed and the results are as below.<br><br>
<b><u>Configuration :</u></b><br>
Project Name : $JOB_NAME<br>
Test Server URL : $Test_Server_URL<br>
Group Name : $Group_Name<br><br>
<b><u>Execution Results :</u></b><br>
Status : <font color="blue">$BUILD_STATUS</font><br>
Tests run : $testCount<br>
Failures : $testFailed<br>
Errors : 0<br>
Skipped : 0<br>
Total time : $buildDuration<br>
Finished at: Tue May 06 17:12:19 IST 2014<br>
Build URL : $BUILD_URL<br><br>
The HTML version of the automation results and the log file is attached with this e-mail for your reference.<br><br>
Regards,<br>
Jenkins CI Tool
</body>
</html>
但是,报告电子邮件在其主体中具有groovy代码本身,而不是预期值。
顺便说一句,如果这个脚本放在test.groovy下电子邮件-EXT插件用@Akos Bannerth答案作为运行按照以下说明,然后我们上线7和9的异常。 。遗漏了什么 ? msgstr“”“在模板呈现过程中引发异常:无法解析模板脚本(您的模板可能包含错误或尝试使用当前不支持的表达式):startup failed:SimpleTemplateScript1.groovy:7:unexpected token:)@ line 7,column 48. assed = String.format(“%。2f”,())^ 1“”“ – gaoithe