Thanks for the quick response. I actually left out a part of that question that I realize now. I am trying to stop a previous build. I am getting the previous build using the jetbrains.buildServer.serverSide.BuildPromotion.getPreviousBuildPromotion method. using the SINCE_LAST_BUILD enum constant so it should get me the last build in the current branch that is running, finished... The problem is that because this is now of type BuildPromotion. Meaning .stop() doesn't work. any tips as to how to get the previous build and stop it.
Given that you have a `BuildPromotion` instance you can call `getAssociatedBuild` method on it.
Then you need to check whether this build is not null and is running using `instanceOf SRunningBuild` check. Then you can cast the build to SRunningBuild and call stop on it.
You can stop a build using the jetbrains.buildServer.serverSide.SRunningBuild:stop method
Dmitry,
Thanks for the quick response. I actually left out a part of that question that I realize now. I am trying to stop a previous build. I am getting the previous build using the jetbrains.buildServer.serverSide.BuildPromotion.getPreviousBuildPromotion method. using the SINCE_LAST_BUILD enum constant so it should get me the last build in the current branch that is running, finished... The problem is that because this is now of type BuildPromotion. Meaning .stop() doesn't work. any tips as to how to get the previous build and stop it.
Max,
Given that you have a `BuildPromotion` instance you can call `getAssociatedBuild` method on it.
Then you need to check whether this build is not null and is running using `instanceOf SRunningBuild` check. Then you can cast the build to SRunningBuild and call stop on it.
Thanks!