Skip to content

Instantly share code, notes, and snippets.

@nehaljwani
Created August 24, 2017 10:29
Show Gist options
  • Select an option

  • Save nehaljwani/20b277e836ae31704ef630cd41bb09f8 to your computer and use it in GitHub Desktop.

Select an option

Save nehaljwani/20b277e836ae31704ef630cd41bb09f8 to your computer and use it in GitHub Desktop.
Jenkins Purge Build Queue By Job Name
import hudson.model.*
def q = Jenkins.instance.queue
q.items.findAll { it.task.name.endsWith('-poc') }.each { q.cancel(it.task) }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment