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

cloudbees, directory, groovy, jenkins, jenkins-scriptler

Solution

def job = Jenkins.instance.getItemByFullName('foldername/jobname');

Problem

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?

Original source