Created
December 21, 2020 20:27
-
-
Save Zeerg/44e47f21511e558d37f531444a96c1a7 to your computer and use it in GitHub Desktop.
Remove bulk jobs using Jenkins Script Console
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import jenkins.model.* | |
def matchedJobs = Jenkins.instance.items.findAll { job -> | |
job.name =~ "regex of jobs" | |
} | |
matchedJobs.each { job -> | |
println job.name | |
//job.delete() Remove the comment to run the purge | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment