Jenkins pipeline - emailextrecipients is empty
Asked Answered
B

1

9

Please note that I'm a beginner working with Jenkins, so I might have missed something obvious.

I'm trying to use the Email-ext plugin in my Jenkins pipeline setup, but I do not seem to be able to retrieve any recipients.

Running the following code in my Jenkinsfile

echo  emailextrecipients([
    [$class: 'DevelopersRecipientProvider'],
    [$class: 'CulpritsRecipientProvider'],
    [$class: 'FirstFailingBuildSuspectsRecipientProvider'],
    [$class: 'FailingTestSuspectsRecipientProvider']])

prints nothing, and the send mail code:

emailext(
    attachLog: true, 
    body: 'Check console output at "<a href="${env.BUILD_URL}">${env.JOB_NAME} [${env.BUILD_NUMBER}]</a>"', 
    recipientProviders: [[$class: 'CulpritsRecipientProvider'], [$class: 'DevelopersRecipientProvider']], 
    subject: 'FAILED: Job \'${env.JOB_NAME} [${env.BUILD_NUMBER}]\':'
)

results in

 An attempt to send an e-mail to empty list of recipients, ignored.

I am able to send example mails, so that seems to be working. Do I need to do anything in the Jenkins setup to define these variables?

Ba answered 30/6, 2017 at 14:39 Comment(0)
R
1

I don't know if you still need an answer but with a colleague we had the same problem and it seems like that our Jenkins was to old and installed the older plugin version. After updating it manually, it was working.

Reconnoitre answered 24/4, 2018 at 16:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.