title: Aggregating test results in Jenkins with Parametrized Jobs
body: <p>I understand this post is similar to:
  <a href="https://stackoverflow.com/questions/19808181/aggregating-results-of-downstream-is-no-test-in-jenkins">Aggregating results of downstream is no test in Jenkins</a></p>
  
  <p>and also to:
  <a href="https://stackoverflow.com/questions/10534480/aggregating-results-of-downstream-parameterised-jobs-in-jenkins?rq=1">Aggregating results of downstream parameterised jobs in Jenkins</a></p>
  
  <p>Nonetheless, I am not able to figure out for my case, how to make this working. I am currently using Jenkins 1.655.</p>
  
  <p>I have jobs A, B, C - A being the upstream job. What I want to do is to have A call B and B call C. All needs to <strong>block</strong> and wait for completion of the next. If one fails, all fails. B and C generate unit test reports. So I want to aggregate these reports in A and then Publish that result in A. So, here's the current setup of the jobs:</p>
  
  <p><strong>Job A:</strong></p>
  
  <p>Build Steps</p>
  
  <ol>
  <li>Execute shell: <code>echo $(date) &gt; aggregate</code></li>
  <li>Trigger Parametrized Buid Job: <strong>Job B</strong></li>
  </ol>
  
  <p>Post Build Steps</p>
  
  <ol>
  <li>Aggregate downstream test results</li>
  <li><strong>Record fingerprints</strong> of files to track usage: set Files to fingerprint to <code>aggregate</code></li>
  <li>Publish JUnit test result report (report files from B and C)</li>
  </ol>
  
  <p><strong>Job B:</strong></p>
  
  <p>Build Steps</p>
  
  <ol>
  <li>Copy artifacts from another project: copy from upstream job <code>aggregate</code> file</li>
  <li>Run tests to generate unit test reports</li>
  <li>Trigger Parametrized Build Job: <strong>Job C</strong></li>
  </ol>
  
  <blockquote>
    <p>It ultimately fails here because <code>aggregate</code> is only archived in the
    Post Build Steps of Job A. <strong>How can I archive an artifact in the Build Step?</strong></p>
  </blockquote>
  
  <p>Post Build Steps</p>
  
  <ol>
  <li>Aggregate downstream test results (unit test.xml generated)</li>
  <li><strong>Record fingerprints</strong> of files to track usage: set Files to fingerprint to <code>aggregate</code></li>
  </ol>
  
  <p>I won't post Job C here for simplicity but it follows pretty much what B does.</p>
  
  <p>So, summing it up, I want to have interlinked jobs that depend on each other and uses the parametrized plugin and the upstream job must aggregate the test results of all downstream.</p>
  
  <p>Any help appreciated, thanks!</p>