Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save utopius/7648f0544bbd12d2f49befd9ee956229 to your computer and use it in GitHub Desktop.
Save utopius/7648f0544bbd12d2f49befd9ee956229 to your computer and use it in GitHub Desktop.
Jenkins disable jobs
Jenkins.instance.items.findAll {job->
job.name.startsWith('<prefix-of-the-jobs>')//add the starting string - name of the job
}.each {
item ->
if (item.disabled == false) {
println item.name
item.disabled=true
item.save()
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment