Email-Ext and Pipeline Model Definition - How to send email notifications Culprits and Developers as recipients?

49 views
Skip to first unread message

Eddard

unread,
Oct 28, 2016, 10:11:00 AM10/28/16
to Jenkins Users
Hello i am trying to send email notification to relevant developers in pipeline using model definition 
with this:

notifications {
        always {
          emailext(body: 'Check console output at ${env.BUILD_URL} to view the results.', recipientProviders: [[$class: 'DevelopersRecipientProvider'], [$class: 'CulpritsRecipientProvider']], subject: '${env.JOB_NAME} ${env.BRANCH_NAME} - Build #${env.BUILD_NUMBER} - FAILED!')
        }
    }

it fails with the following errors:

ERROR: Attempted to execute a notification step that requires a node context. Notifications do not run inside a 'node { ... }' block.
Finished: FAILURE

Trying to understand the error message and the fix it if i can?

Regards

Slide

unread,
Oct 28, 2016, 10:43:28 AM10/28/16
to Jenkins Users

Email-ext needs access to the workspace, so if you don't use it inside a node, it won't work.


--
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/b80ffb06-c458-4aad-957a-3e8e720492d0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael Neale

unread,
Oct 30, 2016, 7:31:22 PM10/30/16
to Jenkins Users
If you put it in postBuild section (similar to notifications) it should work fine. 

It is most unfortunate that emailext requires the workspace. 

Daniel Beck

unread,
Oct 31, 2016, 8:56:18 AM10/31/16
to jenkins...@googlegroups.com

> On 31.10.2016, at 00:31, Michael Neale <mne...@cloudbees.com> wrote:
>
> It is most unfortunate that emailext requires the workspace.

How else are you going to attach files?

Reply all
Reply to author
Forward
0 new messages