I develop a server-side plugin and I need to be able to stop a build in a similar way the agent side plugin stops the build (Terminates execution of the build at the current build stage. Build will be stopped with error and given reason. Build will not be marked as canceled.)
SRunningBuild has 2 methods - stop and setInterrupted, I tried both (combination also), but it always ends up with a build marked as canceled.
There is older answer by for a similar question, but it's already outdated