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

          Elizabeth Chatman created issue -

          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 made changes -
          Component/s New: pipeline-model-definition-plugin [ 21706 ]
          Component/s Original: pipeline [ 21692 ]
          Andrew Bayer made changes -
          Labels New: declarative-variable-and-method-resolution
          Andrew Bayer made changes -
          Assignee New: Andrew Bayer [ abayer ]

          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.
          Andrew Bayer made changes -
          Resolution New: Not A Defect [ 7 ]
          Status Original: Open [ 1 ] New: Resolved [ 5 ]

          Liam Newman added a comment -

          Bulk closing resolved issues.

          Liam Newman added a comment - Bulk closing resolved issues.
          Liam Newman made changes -
          Status Original: Resolved [ 5 ] New: Closed [ 6 ]

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

              Created:
              Updated:
              Resolved: