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

lastSuccessful does not get the last successful artifact

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Minor Minor
    • copyartifact-plugin
    • None

      I have a pipeline that, in case of failure (pointed bythe junit xml), it should compare with the previous successful build. Problem is, `selector: lastSuccessful()` is bringing the last completed run, not the last run marked as "Success".

      The pipeline has the following code:

       

      ```

              stage('Get last execution results') {
                  steps {
                     script

      {                     copyArtifacts projectName: 'OpenSUSE15-dev-helyxTest',                     filter: 'jobGitProperties.yaml',                     selector: lastSuccessful(),                     optional: true                 }

                  }
              }

      ```

       

      And the current list of runs of the pipeline is:

      I was expecting that `lastSuccessful() `would bring the file from build #82, but it is bringing the one from #85, even if that run is marked as Unstable.

            Unassigned Unassigned
            jbiason Julio
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: