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

Jenkinsfile can't access environment variables in parameter descriptions

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      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".

        Attachments

          Activity

          Hide
          echatman Elizabeth Chatman added a comment -

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

          Show
          echatman Elizabeth Chatman added a comment - Actually I think this may be a duplicate of JENKINS-28566 , but I'm not sure
          Hide
          abayer Andrew Bayer added a comment -

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

          Show
          abayer Andrew Bayer added a comment - Yeah, this is expected behavior - the parameters are defined before the environment variables are defined.
          Hide
          bitwiseman Liam Newman added a comment -

          Bulk closing resolved issues.

          Show
          bitwiseman Liam Newman added a comment - Bulk closing resolved issues.

            People

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

              Dates

              Created:
              Updated:
              Resolved: