Reputation: 3695
I have a single job that's shared by multiple projects + branches (triggered with branch-specific settings). Right now what happens is that if there's a build failure then the failure e-mail gets sent out but then an "incorrect" build success e-mail gets sent out when another project gets built. I want to condition the e-mail notification to happen based on parameters rather than the coarse level of a job. Is there any mechanism to accomplish this?
The example set-up is a job named "build". Project A master branch triggers "build" telling it to build project A "master". Project B release branch triggers "build" telling it to build Project B "release". If project A master fails I want the failure notification (which I get) but project B passing shouldn't generate an e-mail because the previous build of "release" didn't generate an e-mail. In other words I want the e-mail pass/fail tracking for project A master & project B release to be independent of each other (e.g. another failure for project A master should generate "still failing e-mail" instead of "new failure").
I'm using the editable e-mail notification plugin but happy to move to a different plugin if there's one that can accomplish this (haven't found it).
Not using jenkins pipeline currently so hopefully this is something easy & can be accomplished strictly from the UI.
Upvotes: 0
Views: 477
Reputation: 3695
So far the best answer I came up with is to restructure the e-mail.
Before I had a job for each project + branch that would trigger the "build" job as a post-submit action & then the "build" step was responsible for the e-mail. Instead I now have it trigger the "build" job as a build step & wait on pass/fail. Then the project + branch job has an e-mail post-build step.
It's not ideal since I have to maintain the e-mail step for each project + branch now but unless there's a better way this is the trade-off for getting correct e-mails.
Upvotes: 0