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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With