/**
* Notify developers of failed build
*/
void notifyFailedBuild() {
final def projectName = packageInfo.getProjectName()
final def repositoryOwners = getRepositoryOwners(projectName)
final def RECIPIENTS = emailextrecipients([
[$class: 'DevelopersRecipientProvider'],
[$class: 'CulpritsRecipientProvider'],
[$class: 'UpstreamComitterRecipientProvider']
])
final def SUBJECT = "${projectName} ${env.BRANCH_NAME} - Build #${env.BUILD_NUMBER} - FAILED!"
final def CONTENT = "Check console output at ${env.BUILD_URL} to view the results."
if (RECIPIENTS != null && !RECIPIENTS.isEmpty()) {
mail to: RECIPIENTS, cc: repositoryOwners, bcc: "devops", replyTo: "donot...@company.com", subject: SUBJECT, body: CONTENT
} else {
mail to: repositoryOwners, bcc: "devops", replyTo: "donot...@company.com", subject: SUBJECT, body: CONTENT
}
}
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/f19567ce-1322-40ee-b9e3-822073762bc7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
final def RECIPIENTS = emailextrecipients([
[$class: 'DevelopersRecipientProvider'],
[$class: 'CulpritsRecipientProvider'],
[$class: 'UpstreamComitterRecipientProvider']
])
step([$class: 'Mailer', notifyEveryUnstableBuild: true, recipients: RECIPIENTS])
emailext body: CONTENT, recipientProviders: [[$class: 'CulpritsRecipientProvider'], [$class: 'DevelopersRecipientProvider'], [$class: 'UpstreamComitterRecipientProvider']], subject: SUBJECT
mail to: RECIPIENTS, cc: repositoryOwners, bcc: "devops", subject: SUBJECT, body: CONTENT
node {
emailext subject: SUBJECT, body: CONTENT, cc: "devops", recipientProviders: [[$class: 'CulpritsRecipientProvider'], [$class: 'DevelopersRecipientProvider'], [$class: 'UpstreamComitterRecipientProvider']]
}
[Pipeline] emailextrecipients [Pipeline] emailext Job type does not allow token replacement. Job type does not allow token replacement. Job type does not allow token replacement. An attempt to send an e-mail to empty list of recipients, ignored.
I followed the Pipeline examples for the email-ext plugin:There are 3 examples how to use emailextrecipientsProblem is only mail allows me to set the cc and bcc.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/b7b18848-9280-4780-a246-a8cfe97ddfe5%40googlegroups.com.
You can set cc and bcc in emailext using prefixes cc:som...@something.com, bcc:som...@something.com
In what parameter, to or recipientProviders?
tirsdag 6. september 2016 19.07.42 UTC+2 skrev slide følgende:You can set cc and bcc in emailext using prefixes cc:som...@something.com, bcc:som...@something.comOn another matter: Not sure why, Every time I try to reply on this discussion, the post gets deleted.
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/66c4402f-b48e-4713-8ef6-24c774e42269%40googlegroups.com.
On Thu, Sep 8, 2016 at 11:25 PM Sverre Moe <sverr...@gmail.com> wrote:In what parameter, to or recipientProviders?In the "to" parameter. The recipient providers always use the "to" and don't provide a way to do cc or bcc.
tirsdag 6. september 2016 19.07.42 UTC+2 skrev slide følgende:You can set cc and bcc in emailext using prefixes cc:som...@something.com, bcc:som...@something.comOn another matter: Not sure why, Every time I try to reply on this discussion, the post gets deleted.Are you a member of the google group? If not, perhaps some moderating is happening.
final def RECIPIENTS = emailextrecipients([
[$class: 'DevelopersRecipientProvider'],
[$class: 'CulpritsRecipientProvider'],
[$class: 'UpstreamComitterRecipientProvider'],
[$class: 'FirstFailingBuildSuspectsRecipientProvider'],
[$class: 'FailingTestSuspectsRecipientProvider']
])
node("master") {
emailext body: CONTENT, recipientProviders: [[$class: 'CulpritsRecipientProvider'], [$class: 'DevelopersRecipientProvider'], [$class: 'UpstreamComitterRecipientProvider'], [$class: 'FirstFailingBuildSuspectsRecipientProvider'], [$class: 'FailingTestSuspectsRecipientProvider']], subject: SUBJECT, to: "cc:${CC},bcc:${BCC}"
}