Skip to content

Instantly share code, notes, and snippets.

View ykhandelwal913's full-sized avatar

yogesh khandelwal ykhandelwal913

View GitHub Profile
import hudson.model.labels.*
Jenkins.instance.getAllItems(Job.class).each{
//println it.name + " - " + it.class + " - " + it.getAssignedLabelString()
if(it.class.simpleName == 'FreeStyleProject') {
jobLabelString = it.getAssignedLabelString()
println it.name + " - " + jobLabelString
//if(jobLabelString.contains('Slave-')){
//if(jobLabelString == "Build_Farm"){
// it.assignedLabel = new LabelAtom('TESTFARM')
// it.save()