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")