Jenkins ver. 2.176.3
Pipeline: Declarative 1.3.9
In a pipeline with multiple sequential stages that typically have either an unstable or a success result, stage post conditions can't be used to take any meaningful action, because one unstable stage dooms the subsequent stages to fire the unsuccessful post condition instead of the success post condition.
Resolved issue https://issues.jenkins-ci.org/browse/JENKINS-52114 references making the post conditions "more stage specific", but from this test, the conditions don't seem stage-specific at all. It's really unclear what the current behavior for the stage post conditions is supposed to be.
Unresolved issue https://issues.jenkins-ci.org/browse/JENKINS-59469 is a little bit similar, in that it asks for a variable with the stage result that can be used in the post section. That would address our overall use case here too (which is sending per-stage notifications). But just having post conditions that referred to the stage would be helpful.
This behavior I think is also described in the commentary on
If there are any workarounds for the current behavior, I'd love to give them a try.