David Gustavsson
David Gustavsson

Reputation: 597

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?

Upvotes: 9

Views: 2073

Answers (1)

sebastianpfischer
sebastianpfischer

Reputation: 195

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.

Upvotes: 1

Related Questions