I can't find a UI way in TeamCity to clear all queued builds in bulk.
One by one is possible, but sometimes triggers/dependencies hit the fan and you end-up with tens of unwanted builds.
REST API is another way, also requires individually cancelling each build.
I expected to have "Remove All" or "Drop Queue" button
There is now an official way to do this :
EDIT (thanks to @taz) Note that this button will only show up if none of the selected builds are running. Either stop all running builds or deselect the running ones first.
Updated version:
const count = $x("//button[contains(@title,'Cancel build...')]").length;
const xxx = $x;
for( i=0 ; i<count ; i++ ) {
setTimeout(() => {
const r = xxx("//button[contains(@title,'Cancel build...')]")[0];
r.click();
setTimeout(() => {
const rem = xxx("//input[@id='submitRemoveQueuedBuild']")[0];
console.log('Button', rem);
rem.click();
}, 1000);
}, i * 2000);
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With