Skip to content

Instantly share code, notes, and snippets.

@rodrigozrusso
Created March 11, 2016 10:07
Show Gist options
  • Save rodrigozrusso/185f2542f47a222f19be to your computer and use it in GitHub Desktop.
Save rodrigozrusso/185f2542f47a222f19be 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