Currently if a when condition filters a stage, there's no way to execute a step in response to that, it just treats it like it never existed. It would be useful to allow something like post.notBuilt (or a new post condition) to execute for a filtered stage (stage.when only - would not make sense in a pipeline.when condition).
My use case is a pipeline that runs a series of verification stages against a Gerrit change (like a pull request), using the Gerrit Code Review plugin to set the status of one or more "Checks". Not all stages have to run on every change though, so I'd rather be more intelligent about skipping stages that don't apply for a change, and still report that feedback in the change UI.
I understand the post.notBuilt block has a different meaning – specifically it executes only if the stage executes and the stage/build result is NOT_BUILT. And that is different from a stage being skipped altogether.
The only other way I can see to achieve this would be another stage that runs with inverted conditions (results in duplication of the when conditions), or by setting an environment variable when the target stage runs, that is then checked in another stage after it (if not set, it didn't run, so mark it NOT_RELEVANT). These solutions all come across as hacks and overly verbose, when all I really need to do is execute some step when the stage would be filtered.
Another option could be something like a new when.otherwise block that executes a step in place of the stage, if the conditions failed: