Environmental variables are always empty in email-ext plugin

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

XMLWordPrintable

    • 270.v8c2ce50dc4fc

      It seems as if environmental variables don't work with the emailext plugin. I am using declarative pipelines, but regardless of what I try the ${ENV, var=""} returns nothing. I can see that the double quoted subject "$VERSION" is correctly replaced and other tokens work such as single quoted '${BUILD_STATUS}' work, but '${ENV, var=""}' and '${ENV, var="VERSION"}' are always replaced empty. Same occurs with variables such as $PATH.

       

      pipeline {
        environment {
          VERSION = "1.0.0"
        }
       
        // ...
        // stages
        // ...
      
        post {
          always {
            emailext (
              to: 'DEFAULT_RECIPIENTS',
              subject: "$VERSION",
              body: '${ENV, var="VERSION"}'
            )
          }
        }
      }
      

       

      Regards

      Erik Hughes

            Assignee:
            Alex Earl
            Reporter:
            Erik Hughes
            Archiver:
            Jenkins Service Account

              Created:
              Updated:
              Resolved:
              Archived: