I want to send email to developers who commited something in the SVN repo in the Jenkins Pipeline.
I have a try and catch (similiar to this try-catch and this try-catch2):
catch(Exception e) {
String error = "${e}"
emailext body: '$DEFAULT_CONTENT',
subject: '$DEFAULT_SUBJECT',
to: 'cronaldo'
}
If anything goes wrong with the build it will send an email to cronaldo (for example; cristiano.ronaldo@hisdomain.com). But this is hardcoded into the catch. I want to have something like get_commiters_id (to: get_commiters_id
) where it gets the id based on a change in the SVN repo by one or many users.
Is there a way to get the user_id from jenkins? I know that the email-ext plugin has a $default_recipients
which sends an email to the user who started the build. The email should be sent when it triggers if something goes wrong.
I guess what I want is the Culprits.