Sending email to $DEFAULT_RECIPIENTS via Pipeline script?

1,684 views
Skip to first unread message

Jim Klo

unread,
Nov 1, 2016, 8:13:06 PM11/1/16
to Jenkins Users
Greetings,

I'm trying to send email to the $DEFAULT_RECIPIENTS settings within my Jenkinsfile Pipeline script, and having very little success.

Here's what I've tried so far:

emailext (
      to: "${DEFAULT_RECIPIENTS}",
      subject: "FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]'",
      body: """<p>FAILED: Job '${env.JOB_NAME} [${env.BUILD_NUMBER}]':</p>
        <p>Check console output at &QUOT;<a href='${env.BUILD_URL}'>${env.JOB_NAME} [${env.BUILD_NUMBER}]</a>&QUOT;</p>""",
      attachLog: true,
      compressLog: true
    )

This just yields the following error:

groovy.lang.MissingPropertyException: No such property: DEFAULT_RECIPIENTS for class: groovy.lang.Binding

And using ${env.DEFAULT_RECIPIENTS} results in a null value.

Can someone provide some pointers?

FWIW using various providers doesn't work for us as the committer id's don't map to a common "@domain.org" address.

Thanks,

Jim

Indra Gunawan (ingunawa)

unread,
Nov 1, 2016, 8:55:58 PM11/1/16
to jenkins...@googlegroups.com
--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/552b049d-8241-44cf-a9b1-c004d816295c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Slide

unread,
Nov 1, 2016, 10:01:04 PM11/1/16
to jenkins...@googlegroups.com
That was added in 2.50 I believe. I added support for pipeline in token-macro and email-ext picked it up and added the necessary stuff to use it.

Reply all
Reply to author
Forward
0 new messages