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

build-user-vars-plugin fails to find correct userId with build pipeline plugin


      With a build pipeline where a downstream plugin is triggered manually from the pipeline view, the BUILD_ environment variables are set from the originating build at the start of the pipeline instead of from the user who manually triggered the build.

      I suspect the build user vars plugin is recursing the getCauses or upstreamCauses until it finds a UserIdCause, however this only deals with the first causeAction of each build.

      It should rather get all causes using: build.getActions(hudson.model.CauseAction.class) 

      and recurse the cause chain similarly by referring to:  cause.upstreamRun.getActions(hudson.model.CauseAction.class) instead of cause.upStreamCauses

      The triggering userId can be found as one of the causes of the build itself, rather than chasing up the upstreamCause

      More detail here: https://stackoverflow.com/a/52816573/2332068

            Unassigned Unassigned
            samliddicott Sam Liddicott
            1 Vote for this issue
            1 Start watching this issue