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

build-step - obtain environment variables from a non-pipeline job

      One of my "Build Flow Plugin" jobs uses an environment variable FUU set by job1. It could be retrieved like:

      {{def b = build( "job1")
      def fuu = b.environment.get( "FUU" )}}

      Note, that job1 is a freestyle (non-pipeline) job.

      As Build Flow is deprecated, I am in the process to migrate this job to the pipeline plugin.
      I would expect that I can access the environment variables by using a snippet like

      {{def b = build 'job1'
      def b.buildVariables.FUU}}

      This does only return null in this case.

      It works correctly if job1 is a pipeline step, which I find counter intuitive.

          [JENKINS-36213] build-step - obtain environment variables from a non-pipeline job

          Benjamin Herbert created issue -
          R. Tyler Croy made changes -
          Workflow Original: JNJira [ 172874 ] New: JNJira + In-Review [ 184821 ]
          Andrew Bayer made changes -
          Component/s New: pipeline-general [ 21692 ]
          Andrew Bayer made changes -
          Component/s Original: workflow-plugin [ 18820 ]
          Jesse Glick made changes -
          Link New: This issue duplicates JENKINS-36528 [ JENKINS-36528 ]
          Jesse Glick made changes -
          Resolution New: Duplicate [ 3 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

            jglick Jesse Glick
            bherb Benjamin Herbert
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: