cloudbees, groovy, jobs, folders: How to determine the job result, if the job is within a cloudbees folder?

alexrjs picture alexrjs · Feb 12, 2014 · Viewed 7k times · Source

Problem: I'm using a script to determine if a certain amount of jobs are in SUCCESS state. It worked fine as long as I was not using cloudbees folder plugin. I could easily get the list of projects and get the project result. But after I moved the jobs to the cloudbee folder, the jobs and therefore the job results are no longer available!

Q: Does anybody now how to get the job results with groovy from jobs which are located in a Cloudbees folder?

Answer

Jesse Glick picture Jesse Glick · Feb 12, 2014
def job = Jenkins.instance.getItemByFullName('foldername/jobname');