Skip to content

Instantly share code, notes, and snippets.

@zregvart
Created March 23, 2017 10:06
Show Gist options
  • Save zregvart/4881a9692b0b661d98be7dd5181f374c to your computer and use it in GitHub Desktop.
Save zregvart/4881a9692b0b661d98be7dd5181f374c to your computer and use it in GitHub Desktop.
Jenkins jobs that have not succeeded in the last 10 builds
import jenkins.branch.MultiBranchProject
Jenkins.instance.items.findAll { job ->
if (job instanceof MultiBranchProject) {
return false
} else {
!job.builds.take(10).any { build ->
build.result == Result.SUCCESS
}
}
}.each { println it.name }
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment