how to subscribe to a build cancel event

Is it possible to somehow get notified in a way when a running build was canceled?

I want to run a custom build step if the build was canceled. I see there is an option at the build step options: Execute always, even if  build stop command was issued. Cool. But how do I determine in that build step that a cancel command was issued or not?

1 comment
Comment actions Permalink

On my own I would send a rest request to the running build from that step and query the status (seems it returns <build id="353" number="17" status="UNKNOWN" ... )

Is this a good solution? If status="UNKNOWN", does it mean that the build was canceled?

0

Please sign in to leave a comment.