gpt4 book ai didi

java - 无法获取在 Jenkins 中发送电子邮件的罪魁祸首列表

转载 作者:行者123 更新时间:2023-12-01 18:34:04 25 4
gpt4 key购买 nike

下面的脚本工作正常,并获取罪魁祸首列表

 def PostFailure()
{
emailext body: "your email body here",
mimeType: 'text/html',
subject: "your subject here",
to: emailextrecipients([
[$class: 'CulpritsRecipientProvider']
])
}

我已经按照下面的代码中提到的方式格式化了电子邮件的正文部分,并且类 CulpritsRecipientProvider 不起作用。

 def PostFailure()
{
def x='1'
def config = [:]
def subject = config.subject ? config.subject : "EPBCS ${env.JOB_NAME} - Release Number:${env.ReleaseNumber} Build #${env.BuildNumber} - ${currentBuild.result}!"
def content = '${SCRIPT,template="groovy-html-ps.template"}'
def attachLog = (config.attachLog != null) ? config.attachLog : (currentBuild.result != "SUCCESS") // Attach buildlog when the build is not successfull
to: emailextrecipients([
[$class: 'RequesterRecipientProvider']
])
}

请帮我修复不起作用的代码。

最佳答案

下面的脚本对我有用。

def postFailure()
{
def content = '${SCRIPT,template="groovy-html.template"}'

emailext body: "${content}",
mimeType: 'text/html',
subject: "this is subject",
to: emailextrecipients([
[$class: 'CulpritsRecipientProvider']
])
}

关于java - 无法获取在 Jenkins 中发送电子邮件的罪魁祸首列表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60098051/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com