title: Jenkins, how to check regressions against another job
body: <p>When you set up a Jenkins job various test result plugins will show regressions if the latest build is worse than the previous one.</p>
  
  <p>We have many jobs for many projects on our Jenkins and we wanted to avoid having a 'job per branch' set up. So currently we are using a parameterized build to build eg different development branches using a single job.</p>
  
  <p>But that means when I build a new branch any regressions are measured against the previous build, which may be for a different branch. What I really want is to measure regressions in a feature branch against the latest build of the <em>master</em> branch.</p>
  
  <p>I thought we should probably set up a separate 'master' build alongside the parameterized 'branches' build.  But I still can't see how I would compare results between jobs. Is there any plugin that can help?</p>
  
  <p>UPDATE</p>
  
  <p>I have started experimenting in the Script Console to see if I could write a post-build script... I have managed to get the latest build of master branch in my parameterized job... I can't work out how to get to the test results from the build object though.</p>
  
  <p>The data I need is available in JSON at<br>
  <code>http://&lt;jenkins server&gt;/job/&lt;job name&gt;/&lt;build number&gt;/testReport/api/json?pretty=true</code></p>
  
  <p>...if I could just get at this data structure it would be great!</p>
  
  <p>I tried using <code>JsonSlurper</code> to load the json via HTTP but I get 403, I guess because my script has no auth session.</p>
  
  <p>I guess I could load the xml test results from disk and parse them in my script, it just seems a bit stupid when Jenkins has already done this.</p>