How to delete jobs on jenkins having the prefix "Data_jobs_" ? and How to disable all jobs having prefix "Data_jobs_server" ?
Anyone know how to do this by going /script page ??
The following should work:
for (job in jenkins.model.Jenkins.theInstance.getProjects()) {
if (job.name.startsWith("Data_jobs_")) {
job.delete()
}
else if (job.name.startsWith("Data_jobs_server")) {
job.disable()
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With