The milestone step cancels older builds with result NOT_BUILT.
It should be possible to optionally override this behavior and set it to something else, e.g. ABORTED.
I want to cancel older PR builds by using this code:
This works as expected, older builds are cancelled with result NOT_BUILT. Now I am using the Bitbucket Branch Source Plugin to automatically report the build status to Bitbucket. In that plugin, the status NOT_BUILT gets mapped to SUCCESS in Bitbucket. If I have a Merge Check to prevent merging of the PR, I now have a situation that the build result is SUCCESS even though it never ran.
So I want to be able to customize the cancelled build's result by overriding it in the milestone step.
The new parameter is optional, and if not overriden, the behavior should be exactly as it was before.