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

Cannot get Jenkins environment variables from Custom stylesheets when using Custom tool configuration

    • Icon: Bug Bug
    • Resolution: Not A Defect
    • Icon: Minor Minor
    • xunit-plugin
    • None
    • Jenkins 2.235.5
      xunit-plugin 2.3.9

      Cannot get Jenkins environment variables from Custom stylesheets when using Custom tool configuration

      Since XLST 3.0 there are two functions to get environment variables within a stylesheet 
      (available-environment-variables and environment-variable)
      I can access to the regular system environment variables but no the environment variables set by Jenkins such as JENKINS_URL, JOB_URL, BUILD_NUMBER, ....

      I've tested with Freestyle jobs and pipeline jobs in Windows and Linux with the same results.

      An example with pipeline:

      pipeline {
          agent  any
          stages {
              stage('Build') { 
                  steps {
                  xunit([Custom(customXSL: 'transform.xslt', deleteOutputFiles: false, failIfNotNew: false, pattern: 'aresult.xml', skipNoTestFiles: false, stopProcessingIfError: false)]) 
       
                  }
              }
          }  
      }
      

      Check the xml file generated in generatedJUnitFiles/ folder. It doesn't list the Jenkins environment variables
       

          [JENKINS-63594] Cannot get Jenkins environment variables from Custom stylesheets when using Custom tool configuration

          jaruzafa created issue -
          jaruzafa made changes -
          Description Original: Cannot get Jenkins environment variables from Custom stylesheets when using Custom tool configuration

          Since XLST 3.0 there are two functions to get environment variables within a stylesheet 
          (available-environment-variables and environment-variable)
          I can access to the regular system environment variables but no the environment variables set by Jenkins such as JENKINS_URL, JOB_URL, BUILD_NUMBER, ....

          I've tested with Freestyle jobs and pipeline jobs in Windows and Linux with the same results.

          An example with pipeline:
          {code}
          pipeline {
              agent  any
              stages {
                  stage('Build') { 
                      steps {
                      xunit([Custom(customXSL: 'transform.xslt', deleteOutputFiles: false, failIfNotNew: false, pattern: 'aresult.xml', skipNoTestFiles: false, stopProcessingIfError: false)]) 
           
                      }
                  }
              }  
          }
          {code}
          Check the file generated in generatedJUnitFiles/ folder. It doen't list the Jenkins environment variables
           
          New: Cannot get Jenkins environment variables from Custom stylesheets when using Custom tool configuration

          Since XLST 3.0 there are two functions to get environment variables within a stylesheet 
          (available-environment-variables and environment-variable)
          I can access to the regular system environment variables but no the environment variables set by Jenkins such as JENKINS_URL, JOB_URL, BUILD_NUMBER, ....

          I've tested with Freestyle jobs and pipeline jobs in Windows and Linux with the same results.

          An example with pipeline:
          {code}
          pipeline {
              agent  any
              stages {
                  stage('Build') { 
                      steps {
                      xunit([Custom(customXSL: 'transform.xslt', deleteOutputFiles: false, failIfNotNew: false, pattern: 'aresult.xml', skipNoTestFiles: false, stopProcessingIfError: false)]) 
           
                      }
                  }
              }  
          }
          {code}
          Check the file generated in generatedJUnitFiles/ folder. It doesn't list the Jenkins environment variables
           
          jaruzafa made changes -
          Description Original: Cannot get Jenkins environment variables from Custom stylesheets when using Custom tool configuration

          Since XLST 3.0 there are two functions to get environment variables within a stylesheet 
          (available-environment-variables and environment-variable)
          I can access to the regular system environment variables but no the environment variables set by Jenkins such as JENKINS_URL, JOB_URL, BUILD_NUMBER, ....

          I've tested with Freestyle jobs and pipeline jobs in Windows and Linux with the same results.

          An example with pipeline:
          {code}
          pipeline {
              agent  any
              stages {
                  stage('Build') { 
                      steps {
                      xunit([Custom(customXSL: 'transform.xslt', deleteOutputFiles: false, failIfNotNew: false, pattern: 'aresult.xml', skipNoTestFiles: false, stopProcessingIfError: false)]) 
           
                      }
                  }
              }  
          }
          {code}
          Check the file generated in generatedJUnitFiles/ folder. It doesn't list the Jenkins environment variables
           
          New: Cannot get Jenkins environment variables from Custom stylesheets when using Custom tool configuration

          Since XLST 3.0 there are two functions to get environment variables within a stylesheet 
          (available-environment-variables and environment-variable)
          I can access to the regular system environment variables but no the environment variables set by Jenkins such as JENKINS_URL, JOB_URL, BUILD_NUMBER, ....

          I've tested with Freestyle jobs and pipeline jobs in Windows and Linux with the same results.

          An example with pipeline:
          {code}
          pipeline {
              agent  any
              stages {
                  stage('Build') { 
                      steps {
                      xunit([Custom(customXSL: 'transform.xslt', deleteOutputFiles: false, failIfNotNew: false, pattern: 'aresult.xml', skipNoTestFiles: false, stopProcessingIfError: false)]) 
           
                      }
                  }
              }  
          }
          {code}
          Check the xml file generated in generatedJUnitFiles/ folder. It doesn't list the Jenkins environment variables
           
          Nikolas Falco made changes -
          Priority Original: Major [ 3 ] New: Minor [ 4 ]
          Nikolas Falco made changes -
          Resolution New: Not A Defect [ 7 ]
          Status Original: Open [ 1 ] New: Closed [ 6 ]

            nfalco Nikolas Falco
            jaruzafa jaruzafa
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: