-
Bug
-
Resolution: Unresolved
-
Minor
-
Jenkins(ver. 2.222.1)
Jenkins DSL plugin((v1.77)
extendedEmail plugin(v2.69)
We use multi configuration project on Jenkins(ver. 2.222.1) We use JenkinsDSL(v1.77) to create the free-style jobs from the groovy scripts. Email notifications is with extendedEmail(v2.69)
It seems like trigger mode for notifications cannot be specified in the groovy script but it could be done via the UI as below(ONLY_PARENT or ONLY_CONFIGURATIONS or BOTH)
As I see we could specify for extendedEmail in groovy for DSL plugin as below
job('example') { publishers { extendedEmail { recipientList('me@halfempty.org') defaultSubject('Oops') defaultContent('Something broken') contentType('text/html') triggers { beforeBuild() stillUnstable { subject('Subject') content('Body') sendTo { developers() requester() culprits() } } } } } }
I was wondering if we had something similar to hipChatNotifier as below ( matrixTriggerMode('ONLY_PARENT'))
job('example') { publishers { hipChatNotifier { room('Dev Team A, QA') matrixTriggerMode('ONLY_PARENT') startJobMessage(null) completeJobMessage(null) token(null) notifications { notificationConfig { notifyEnabled(true) textFormat(true) notificationType('ABORTED') color('GRAY') messageTemplate(null) }
How do I achieve it for extendedEmail? As I could do the same via the UI
The doc:
https://myjenkins/plugin/job-dsl/api-viewer/index.html#method/javaposse.jobdsl.dsl.helpers.publisher.PublisherContext.extendedEmailPublisher
Shows:
But errors out if you try to use it:
So I had to add the configure as mentioned here: https://stackoverflow.com/questions/65626829/matrix-trigger-mode-in-extendedemail-jenkins-job-dsl