Environment section of Declarative pipelines does not allow setting of blank strings

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

XMLWordPrintable

      When setting an environment variable equal to a blank string it comes back a the literal string of `null` instead of being a blank string

      Steps to reproduce:

      1. Create a new pipeline job with the following definition:
        pipeline {
            agent any
            environment {
                VERSION_SUFFIX = ''
            }
            stages {
                stage("test") {
                    steps{
                        echo "env.VERSION_SUFFIX = ${env.VERSION_SUFFIX}"
                    }
                }
            }
        }
        
      1. Run said pipeline
      2. Observe the output is `
        env.VERSION_SUFFIX = null

      Expected result:

      Normally I would expect it to just be a blank string or nothing there

            Assignee:
            Unassigned
            Reporter:
            Alex Taylor
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Archived: