0

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)

0

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.

1

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 – Andrey Regentov May 3 '18 at 8:48

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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