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

Jenkinsfile can't access environment variables in parameter descriptions

      This does not work:

      pipeline {
          environment {
              FOO = "bar"
          }
          parameters {
              string(name: 'BAZ', defaultValue: '', description: "Foo = $env.FOO")
          }
      

      The description for the parameter is always "Foo = null" instead of "Foo = bar".

          [JENKINS-45810] Jenkinsfile can't access environment variables in parameter descriptions

          Actually I think this may be a duplicate of JENKINS-28566, but I'm not sure

          Elizabeth Chatman added a comment - Actually I think this may be a duplicate of JENKINS-28566 , but I'm not sure

          Andrew Bayer added a comment -

          Yeah, this is expected behavior - the parameters are defined before the environment variables are defined.

          Andrew Bayer added a comment - Yeah, this is expected behavior - the parameters are defined before the environment variables are defined.

          Liam Newman added a comment -

          Bulk closing resolved issues.

          Liam Newman added a comment - Bulk closing resolved issues.

            abayer Andrew Bayer
            echatman Elizabeth Chatman
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: