Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-33577

"Unable to find a build" when using DownstreamBuildSelector with Jenkins Pipelines

XMLWordPrintable

      Given two basic Jenkins Pipelines:

      //Pipeline 'a'

      stage 'stage'
          node{
              build 'b'
              step([$class: 'CopyArtifact', projectName: 'b', selector: [$class: 'DownstreamBuildSelector', upstreamBuildNumber: env.BUILD_NUMBER, upstreamProjectName: env.JOB_NAME]])
          }
      

      //Pipeline 'b'

      stage 'stage'
          node{
              writeFile file: 'target/b.txt', text: 'b'
              archive includes:'target/b.txt'
          }
      

      Copy artifact cannot find the right build from the Pipeline, consistently returning:

      ERROR: Unable to find a build for artifact copy from: b
      Finished: FAILURE

      It doesn't work when removing the env.XYZ variables and passing in hard-coded values either.

            Unassigned Unassigned
            apemberton Andy Pemberton
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: