Before Pipeline, I used Email-ext plugin to define triggers for sending emails (on first failure, and when back to success).

But in the Pipeline version, I can't control the triggers, I can only "send always", or send based on current build result.

How do I send emails in pipeline based on more general triggers? (first failure, first success, etc)

2 Answers 2


You can use snippet like

post {
    changed {
        emailext body: '$DEFAULT_CONTENT', recipientProviders: [brokenTestsSuspects(), brokenBuildSuspects(), developers()], subject: '$DEFAULT_SUBJECT'

in declarative pipelines.

Changed post-condition is called when the build result is changed (i.e. of first failure and back to success). There are post-conditions like "regression" if you want more control.


This seems not to be possible at the moment with pipelines. See this Jira ticket.

  • this jira ticket is about changing list of emailed users, not the triggers from question Commented May 3, 2018 at 8:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.