View difference between Paste ID: JgzcKjYN and ngXDzwM9
SHOW: | | - or go back to the newest paste.
1-
def saySomething = { 
1+
//In Jenkins, try to rebuild all the job in failure
2-
  println it 
2+
def jobInFailure = { job -> job.lastBuild.result == Result.FAILURE}
3-
} 
3+
4
Jenkins.instance.items.findAll(​jobInFailure).each{
5-
saySomething("Hello, World!") 
5+
 println "Let's retry ${it.name}"
6-
//>Hello, World!
6+
 it.scheduleBuild2(0)
7-
saySomething.call("Hello, World!")
7+
}​