jakubjosef
7/24/2017 - 1:50 PM

Disable Jenkins jobs with condition

Disable Jenkins jobs with condition

def jobs = Jenkins.instance.items.findAll { it.name.startsWith("test") || it.name.startsWith("deploy") }
def counter = 0
for (job in  jobs) {
    job.disabled = true
    counter++
}
print("Disabled ${counter} jobs")