Skip to content

Instantly share code, notes, and snippets.

@wrossmck
Created October 9, 2018 18:30
Show Gist options
  • Save wrossmck/19a06bd57029768ba0cc186438b6d354 to your computer and use it in GitHub Desktop.
Save wrossmck/19a06bd57029768ba0cc186438b6d354 to your computer and use it in GitHub Desktop.
cancel all builds in queue called
// cancel all builds in queue called
import hudson.model.*
def q = Jenkins.instance.queue
q.items.each {
println (it)
if (it =~ /my.job.to.kill/) {
q.cancel(it.task)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment