I am working on to send an email on build failure to the users who had committed the code in Jenkins. I am using pipeline script. But i am struck now as i am manually adding the username. How to automatically add recipient mail in Jenkins. Here is the code i have written. emailtext attachLog: true,body: '', compressLog: true, recipientProviders: [[$class: 'DevelopersRecipientProvider']], subject:'Test results' emailtext body : 'Commit failure', subject: 'Test-failure', to: 'abc@xyz.com'
emailtext attachLog: true,body: '', compressLog: true, recipientProviders: [[$class: 'DevelopersRecipientProvider']], subject:'Test results' emailtext body : 'Commit failure', subject: 'Test-failure', to: 'abc@xyz.com'
script{ def recipients = emailextrecipients([ [$class: 'DevelopersRecipientProvider'],[$class: 'CulpritsRecipientProvider']]) mail to: recipients, subject: "Failure", body: "failure" }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)