Here's a sample function we call in our pipeline

def processTestFailure() {
    junit "**/build/test-results/**/*.xml" 
    emailext body: "<strong><font color=\"red\">You broke the 
build</font></strong><br /><br /> It appears that ${env.BUILD_URL} tests 
are failing (${currentBuild.result}). <br /><br />Change sets:<br 
/>${changelist()}<br /><br />${testStatuses()}", recipientProviders: [[
$class: "FailingTestSuspectsRecipientProvider"], [$class: 
"FirstFailingBuildSuspectsRecipientProvider"], [$class: 
"CulpritsRecipientProvider"]], subject: "FAILING TEST - ${env.JOB_NAME} 
(${env.BUILD_NUMBER}) - ${currentBuild.result}" 
}


On Friday, February 15, 2019 at 2:53:41 PM UTC-5, Zach LaCelle wrote:
>
> For my "build failed" emails, I'd like to send an email from my Jenkins 
> Declarative Pipeline to the developers group but also to a fixed list of 
> recipients. Under the Pipeline documentation (
> https://jenkins.io/doc/pipeline/steps/email-ext/), I see a class for 
> "recipients", which states that it includes "recipients defined in the 
> "Project Recipient List.""
>
> My question is: how do I add a list of emails to the "Project Recipient 
> List"? Where is this list defined for Declarative pipelines? If I can add 
> to this list, then I think I can add something like: recipientProviders: 
> [[$class: 'DevelopersRecipientProvider'], [$class: 
> 'RecipientsRecipientProvider']]
>
> Or, if I can't do this, then I could also add a "to:" at the end of the 
> emailext declaration. How do I add multiple users to this entry? Are they 
> comma-separated, or semi-colon separated? Will they automatically have the 
> default domain added?
>

-- 
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-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/7397d337-2906-477c-b55a-56fc7b8186df%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to