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

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

XMLWordPrintable

    • 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
       

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

              Created:
              Updated:
              Resolved: