I have just configured some jobs to send emails on "Failure - 2nd" and "Fixed".
The behavior I'm seeing is that if the job has ever failed in the past, then the "Failure - 2nd" email gets sent on every subsequent build, even if the build is successful.
Here's the output I see in Jenkins:
The expected behavior, according to the plugin doc, is that it would only be sent on successive failures. Note that this build is neither a failure, nor a successive failure.
|Field||Original Value||New Value|
|Summary||2nd failure emails being sent even when build is successful||2nd failure emails being sent even when build is successful with job-dsl-plugin|
|Resolution||Fixed [ 1 ]|
|Status||Open [ 1 ]||Closed [ 6 ]|
|Component/s||job-dsl-plugin [ 16720 ]|