Created
December 7, 2017 16:46
-
-
Save or-shachar/572338c62be71d3651f16fc632337d2e to your computer and use it in GitHub Desktop.
Counts jobs that failed by name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
job_name="some-name" //I have multiple jobs with the same simple name under multiple folders | |
instance = Jenkins.instance | |
def jobs = instance.allItems.findAll{it.name==job_name} | |
count = 0 | |
for (job in jobs){ | |
lastRun = job.lastCompletedBuild | |
if (lastRun==null || lastRun.result != Result.SUCCESS){ | |
println job.fullName + " " + instance.rootUrl + lastRun.url | |
count = count + 1 | |
} | |
} | |
println "${count} out of ${jobs.size}" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment