Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // For all the jobs in the Summary view.
- hudson.model.Hudson.instance.getView('All - Summary').items.each() {
- def build = it.getLastBuild()
- // If they are failed and haven't any description.
- if (build.result == Result.FAILURE && !build.description) {
- println "Job: " + it.fullDisplayName
- // Look for detected annotations
- def BFA = build.actions.find{ it instanceof com.sonyericsson.jenkins.plugins.bfa.model.FailureCauseBuildAction };
- if (BFA != null) {
- // Join all the indications into string.
- def indicationsList = BFA.getFoundFailureCauses().collect{ it.getName() }
- def indications = indicationsList.join(' + ')
- println(" Failure causes: " + indications)
- // Failure causes found, set the description to them.
- if (indications) {
- build.description = indications
- println " Set!"
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment