title: How to copy artifacts in a "diamond-join" Jenkins build pipeline?
body: <p>Is there any documentation/examples on the <a href="https://wiki.jenkins-ci.org/display/JENKINS/Copy+Artifact+Plugin" rel="nofollow noreferrer">Copy Artifacts Plugin</a>, namely the "Specified by a build parameter" option?</p>
  
  <p>I'm trying to do a "join-diamond" pipeline such as in <a href="https://stackoverflow.com/questions/16795161/copying-artifacts-from-multiple-upstream-jobs-at-join-in-jenkins">this SO question</a> and can't figure out what to put in the <code>Parameter Name</code> option of the "Copy artifacts from another project" build step to get my artifacts copied properly.</p>
  
  <p><img src="https://i.stack.imgur.com/STRaX.png" alt="enter image description here"></p>
  
  <p>All my jobs have a <code>PL_BUILD_NUMBER</code> parameter and I'd like to use it to select which build to copy the artifacts from.</p>
  
  <p>This <a href="http://jenkins-ci.361315.n4.nabble.com/Copy-artifacts-from-specific-job-build-td3341935.html" rel="nofollow noreferrer">mailing list post</a> says the parameter must be an XML. So I tried this :</p>
  
  <pre><code>BUILD_SELECTOR=&lt;SpecificBuildSelector&gt;&lt;buildNumber&gt;$PL_BUILD_NUMBER&lt;/buildNumber&gt;&lt;/SpecificBuildSelector&gt;
  </code></pre>
  
  <p>but it did not work. I get this exception in the log:</p>
  
  <pre><code>java.lang.NullPointerException
      at java.io.StringReader.&lt;init&gt;(Unknown Source)
      at com.thoughtworks.xstream.XStream.fromXML(XStream.java:1035)
      at hudson.plugins.copyartifact.BuildSelectorParameter.getSelectorFromXml(BuildSelectorParameter.java:80)
      at hudson.plugins.copyartifact.ParameterizedBuildSelector.getBuild(ParameterizedBuildSelector.java:52)
      at hudson.plugins.copyartifact.CopyArtifact.perform(CopyArtifact.java:280)
      at hudson.tasks.BuildStepMonitor$1.perform(BuildStepMonitor.java:20)
      at hudson.model.AbstractBuild$AbstractBuildExecution.perform(AbstractBuild.java:772)
      at hudson.model.Build$BuildExecution.build(Build.java:199)
      at hudson.model.Build$BuildExecution.doRun(Build.java:160)
      at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:535)
      at hudson.model.Run.execute(Run.java:1740)
      at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
      at hudson.model.ResourceController.execute(ResourceController.java:88)
      at hudson.model.Executor.run(Executor.java:233)
  </code></pre>
  
  <p>What should I put?</p>
  
  <p>There's also the "This build is parametrized --> Build selector for Copy Artifact" that I don't know if I should use it...</p>
  
  <p>Thanks!</p>