Jenkins EMail-ext插件在Email主体中发送groovy代码

 舞动青春的迪斯科舞厅 发布于 2023-01-16 13:20

扩展电子邮件通知的"默认内容"设置如下,默认内容类型为"HTML(文本/ html)":



<%
    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,

The execution of the Automation suite has been completed and the results are as below.

Configuration :
Project Name : $JOB_NAME
Test Server URL : $Test_Server_URL
Group Name : $Group_Name

Execution Results :
Status : $BUILD_STATUS
Tests run : $testCount
Failures : $testFailed
Errors : 0
Skipped : 0
Total time : $buildDuration
Finished at: Tue May 06 17:12:19 IST 2014
Build URL : $BUILD_URL

The HTML version of the automation results and the log file is attached with this e-mail for your reference.

Regards,
Jenkins CI Tool

但是报告电子邮件在其正文中具有groovy代码本身而不是预期值.

撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有