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

Folder properties not available in declarative environment step

      Folder properties set on an Organization Folder project is not available in the "environment" step

      With the following property set:
      Name: TEST_VAR
      Value: TRUE

      pipeline {
          agent none
      
          options {
              withFolderProperties()
          }
      
          environment {
              IS_SET = "${env.TEST_VAR}"
          }
      
          stages {
              stage ('Test')
              {
                  agent any
                  steps {
                      echo "TEST_VAR: ${env.TEST_VAR}!!!"
                      echo "IS_SET: ${env.IS_SET }!!!"
                  }
              }
          }
      }
      

      I get the following result:

      [Pipeline] echo
      TEST_VAR: TRUE!!!
      [Pipeline] echo
      IS_SET  : null!!!
      

          [JENKINS-68522] Folder properties not available in declarative environment step

          Carel Combrink created issue -
          Carel Combrink made changes -
          Description Original: Folder properties set on an Organization Folder project is not available in the "environment" step

          With the following property set:
          Name: TEST_VAR
          Value: TRUE
          {code}

          pipeline {
              agent none

              options {
                  withFolderProperties()
              }

              environment {
                  IS_SET = "${env.TEST_VAR}"
              }

              stages {
                  stage ('Test')
                  {
                      agent any
                      steps {
                          echo "TEST_VAR: ${env.TEST_VAR}!!!"
                          echo "IS_SET: ${env.IS_SET }!!!"
                      }
                  }
              }
          }
          {code}
          New: Folder properties set on an Organization Folder project is not available in the "environment" step

          With the following property set:
          Name: TEST_VAR
          Value: TRUE
          {code}

          pipeline {
              agent none

              options {
                  withFolderProperties()
              }

              environment {
                  IS_SET = "${env.TEST_VAR}"
              }

              stages {
                  stage ('Test')
                  {
                      agent any
                      steps {
                          echo "TEST_VAR: ${env.TEST_VAR}!!!"
                          echo "IS_SET: ${env.IS_SET }!!!"
                      }
                  }
              }
          }
          {code}

          I get the following result:
          {code}
          [Pipeline] echo
          TEST_VAR: TRUE!!!
          [Pipeline] echo
          IS_SET : null!!!
          {code}
          Mark Waite made changes -
          Summary Original: Folder Properties set on Organisation Folder not available in global environment step (declarative) New: Folder properties not available in declarative environment step
          Mark Waite made changes -
          Assignee Original: Miguelángel Fernández [ mig82 ]

            Unassigned Unassigned
            carelc Carel Combrink
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: