Skip to content

Instantly share code, notes, and snippets.

@itsprdp
Last active October 31, 2022 08:48
Show Gist options
  • Save itsprdp/b79d7fd088916a26c99af1a9f9cf0bfd to your computer and use it in GitHub Desktop.
Save itsprdp/b79d7fd088916a26c99af1a9f9cf0bfd to your computer and use it in GitHub Desktop.
Groovy script to disable all jenkins jobs in a view
jenkins = Hudson.instance
jenkins.instance.getView("PS_Portal").items.each { job ->
println "\nJob: $job.name"
job.disabled = true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment