-
Bug
-
Resolution: Unresolved
-
Critical
-
None
-
master node on Ubuntu x64
slave node on Windows
I send my mail via groovy script in a multibranch-pipeline (blue ocean)
script { def currResult = getResultAsString(currentBuild) def prevResult = getResultAsString(currentBuild.getPreviousBuild()) if (currResult != "SUCCESS" || prevResult != "SUCCESS") { echo 'send mail' emailext body: '''${SCRIPT, template="my-html.template"}''', recipientProviders: [[$class: 'DevelopersRecipientProvider'], [$class: 'CulpritsRecipientProvider'], [$class: 'UpstreamComitterRecipientProvider'], ], subject: '[Jenkins]: ${JOB_NAME} ${BUILD_DISPLAY_NAME} - ' + currResult, mimeType: 'text/html' } } def getResultAsString(build) { def result = build?.result if (result == null) { result = "SUCCESS" } return result; }
When creating a new branch and adding a commit which will fail this build,
jenkins will not send a email, with following message:
An attempt to send an e-mail to empty list of recipients, ignored.
However, when adding another commit to the same branch, jenkins, will now surprisingly have a commiter email address and can send the email.
So always the first build of a new branch, email-ext will not retrieve a correct email from the commit.
Can you please fix it?
I just think it logically makes sense when a new branch is created in a multi branch style job that the creation of the branch should be classified as a change which in turn would cause every other plugin that uses the list of developers/commiters to do something would pick this up. I think most users would expect this to be the case in multi branch. Not sure if the responsibility to do this lives in the multi branch plugin, scm api, the scm plugin/driver or a combination, I just think its what users would expect, I know I would, not that I have actually tested with SVN (which I use I work). I could code a special case in emailext but I think it would be better if its handled globally