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

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

    Details

    • Similar Issues:

      Description

      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.

        Attachments

          Issue Links

            Activity

            apemberton Andy Pemberton created issue -
            apemberton Andy Pemberton made changes -
            Field Original Value New Value
            Description Given two very basic Jenkins Pipelines:

            //Pipeline 'a'

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


            //Pipeline 'b'

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

            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.
            Given two basic Jenkins Pipelines:

            //Pipeline 'a'

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


            //Pipeline 'b'

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

            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.
            jglick Jesse Glick made changes -
            Labels workflow
            jglick Jesse Glick made changes -
            Remote Link This issue links to "PR 80 (Web Link)" [ 14078 ]
            jglick Jesse Glick made changes -
            Link This issue is related to JENKINS-31576 [ JENKINS-31576 ]
            jglick Jesse Glick made changes -
            Link This issue depends on JENKINS-29913 [ JENKINS-29913 ]
            jglick Jesse Glick made changes -
            Link This issue is related to JENKINS-33578 [ JENKINS-33578 ]
            jglick Jesse Glick made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Resolution Not A Defect [ 7 ]
            jglick Jesse Glick made changes -
            Link This issue is related to JENKINS-36152 [ JENKINS-36152 ]
            rtyler R. Tyler Croy made changes -
            Workflow JNJira [ 169529 ] JNJira + In-Review [ 198628 ]
            abayer Andrew Bayer made changes -
            Labels workflow pipeline workflow
            abayer Andrew Bayer made changes -
            Labels pipeline workflow pipeline
            cloudbees CloudBees Inc. made changes -
            Remote Link This issue links to "CloudBees Internal OSS-745 (Web Link)" [ 18839 ]
            ikedam ikedam made changes -
            Status Resolved [ 5 ] Closed [ 6 ]

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: