Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Jenkins pipeline - emailextrecipients is empty

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?

like image 820
David Gustavsson Avatar asked Jun 30 '17 14:06

David Gustavsson


1 Answers

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.

like image 166
SebPF Avatar answered Sep 20 '22 13:09

SebPF