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

This issue is archived. You can view it, but you can't modify it. Learn more

XMLWordPrintable

      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.

            Assignee:
            Jesse Glick
            Reporter:
            Benjamin Herbert
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: