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

PROPFILE token does not evaluate in the Editable E-mail Notification for the email-ext plugin

      The PROPFILE token is not evaluating in the Editable E-mail Notification for the e-mail-ext plugin.

      For example, when I put this in the Default Content of the e-mail:

      ${PROPFILE,file="props.cfg",property="TESTING_VAR"}

      The value of "TESTING_VAR" is not displayed in the e-mail. Instead, this is displayed:

      ${PROPFILE,file="props.cfg",property="TESTING_VAR"}

      This PROPFILE token works when I put it in the "Set Build Name" field for the build-name-setter plugin.

      So the build-name-setter plugin is able to consume the PROPFILE token, but the e-mail-ext plugin does not seem to be consuming it properly.

      I am running Jenkins 1.480.2 with email-ext - 2.24.1.

          [JENKINS-16779] PROPFILE token does not evaluate in the Editable E-mail Notification for the email-ext plugin

          Alex Earl added a comment -

          PROPFILE is not an email-ext token, so it won't be consumed.

          Alex Earl added a comment - PROPFILE is not an email-ext token, so it won't be consumed.

          Kavita Tiwari added a comment -

          When I look at the "Content Token Reference" help for the email-ext plugin this appears:

          <snippit from Content Token Reference>
          Token Macro Plugin Tokens

          ${BUILD_NUMBER}
          Expands to the current build number, a sequential auto-incrementing unique number that identifies the build, such as "125"
          ${ENV,var="VARIABLENAME"}
          Expands to an environment variable (specified here as VARIABLENAME) from the build environment. Note that this does not include any variables set by the build scripts themselves, only those set by Jenkins and other plugins.
          ${PROPFILE,file="FILENAME",property="PROPERTYNAME"}
          Expands to the value of a property in a property file. The filename is relative to the build workspace root.
          <snippit from Content Token Reference>

          It shows PROPFILE as a token-macro plugin token that can be used by the email-ext plugin. The other tokens listed above work (BUILD_NUMBER and ENV). As such, I figured that it could be used by the email-ext plugin.

          Kavita Tiwari added a comment - When I look at the "Content Token Reference" help for the email-ext plugin this appears: <snippit from Content Token Reference> Token Macro Plugin Tokens ${BUILD_NUMBER} Expands to the current build number, a sequential auto-incrementing unique number that identifies the build, such as "125" ${ENV,var="VARIABLENAME"} Expands to an environment variable (specified here as VARIABLENAME) from the build environment. Note that this does not include any variables set by the build scripts themselves, only those set by Jenkins and other plugins. ${PROPFILE,file="FILENAME",property="PROPERTYNAME"} Expands to the value of a property in a property file. The filename is relative to the build workspace root. <snippit from Content Token Reference> It shows PROPFILE as a token-macro plugin token that can be used by the email-ext plugin. The other tokens listed above work (BUILD_NUMBER and ENV). As such, I figured that it could be used by the email-ext plugin.

          Alex Earl added a comment -

          What version of the token-macro plugin do you have installed? I had forgotten about the token macro plugin, sorry for the confusion.

          Alex Earl added a comment - What version of the token-macro plugin do you have installed? I had forgotten about the token macro plugin, sorry for the confusion.

          Kavita Tiwari added a comment -

          No worries. I'm using token-macro - 1.5.1. Looking at the release notes for the token-macro plugin, it "Added macro for retrieving properties from property files in the build workspace." in Version 1.3.

          Kavita Tiwari added a comment - No worries. I'm using token-macro - 1.5.1. Looking at the release notes for the token-macro plugin, it "Added macro for retrieving properties from property files in the build workspace." in Version 1.3.

          Alex Earl added a comment -

          Can you try upgrading to 2.25?

          Alex Earl added a comment - Can you try upgrading to 2.25?

          Alex Earl added a comment -

          I added a specifically for this token, and it works for me in the test. This is with the 2.25 source code, so please upgrade and see if the issue is still there.

          Alex Earl added a comment - I added a specifically for this token, and it works for me in the test. This is with the 2.25 source code, so please upgrade and see if the issue is still there.

          Kavita Tiwari added a comment -

          Upgraded email-ext to 2.25 and it works! Thanks very much Alex! This issue can be closed.

          Kavita Tiwari added a comment - Upgraded email-ext to 2.25 and it works! Thanks very much Alex! This issue can be closed.

          Alex Earl added a comment -

          Upgraded to latest and issue no longer occurred.

          Alex Earl added a comment - Upgraded to latest and issue no longer occurred.

          Jesse Glick added a comment -

          (reopening just to clear bad labels)

          Jesse Glick added a comment - (reopening just to clear bad labels)

            slide_o_mix Alex Earl
            trincodog Kavita Tiwari
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: