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

email-ext cannot expand ${FAVORITE_USERS_EMAIL} macro in pipeline

    XMLWordPrintable

    Details

    • Similar Issues:

      Description

      When passing the ${FAVORITE_USERS_EMAIL} macro in the 'to:' line of a pipeline call to email-ext, jenkins errors with: "FAVORITE_USERS_EMAIL" is not supported in this context. 

      I also cannot expand the ${FAVORITE_USERS_EMAIL} token using the 'tk' step to get the list of users who have favorited a job and include them in the email. The same error message is thrown. 

        Attachments

          Activity

          Hide
          raorao rao rao added a comment -

          The Favorites plugin generates that file for each job that has been Favorited.

          Show
          raorao rao rao added a comment - The Favorites plugin generates that file for each job that has been Favorited.
          Hide
          slide_o_mix Alex Earl added a comment -

          Where is FAVORITE_USERS_EMAIL defined? Is it a job parameter, or an environment variable? I don't think it is a token (from token-macro). If it's a parameter or environment variable, you should be able to access it as:

          emailext body: 'Hello World - fifth', recipientProviders: [recipients()], subject: 'Hi', to: FAVORITE_USERS_EMAIL
          

          or

          Show
          slide_o_mix Alex Earl added a comment - Where is FAVORITE_USERS_EMAIL defined? Is it a job parameter, or an environment variable? I don't think it is a token (from token-macro). If it's a parameter or environment variable, you should be able to access it as: emailext body: 'Hello World - fifth' , recipientProviders: [recipients()], subject: 'Hi' , to: FAVORITE_USERS_EMAIL or
          Hide
          raorao rao rao added a comment -

          FAVORITE_USERS_EMAIL is a Token Macro as part of [Favorite |https://plugins.jenkins.io/favorite] plugin.

          Show
          raorao rao rao added a comment - FAVORITE_USERS_EMAIL is a Token Macro as part of [Favorite | https://plugins.jenkins.io/favorite ] plugin.
          Hide
          slide_o_mix Alex Earl added a comment -

          That token won't work in a pipeline job, it has not been updated to support pipeline.

          Show
          slide_o_mix Alex Earl added a comment - That token won't work in a pipeline job, it has not been updated to support pipeline.
          Show
          slide_o_mix Alex Earl added a comment - See https://github.com/jenkinsci/email-ext-plugin/blob/master/src/main/java/hudson/plugins/emailext/plugins/content/FailedTestsContent.java#L46-L96 for an example of how to allow the token to work in pipeline jobs.

            People

            • Assignee:
              jamesdumay James Dumay
              Reporter:
              bbyjnks m c
            • Votes:
              3 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: