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

CHANGES_SINCE_LAST_SUCCESS is not expanded for jenkins pipeline

    Details

    • Similar Issues:

      Description

      Following doesn't work in pipeline

      emailext body: '${CHANGES_SINCE_LAST_SUCCESS, reverse="true", showPaths="true"}', subject: 'Test email', to: 'user.email@mycompany.com'

      It would be good to have this in place to get changeset from last successful build

        Attachments

          Issue Links

            Activity

            Hide
            winnerwbx Andy Wang added a comment -

            I've read JENKINS-35367, but still don't get how to use {CHANGES_SINCE_LAST_SUCCESS, reverse="true", showPaths="true"} in pipeline. Is it right to put it in a template and use it? An example would be nice. Thank you!

            Show
            winnerwbx Andy Wang added a comment - I've read JENKINS-35367 , but still don't get how to use {CHANGES_SINCE_LAST_SUCCESS, reverse="true", showPaths="true"} in pipeline. Is it right to put it in a template and use it? An example would be nice. Thank you!
            Hide
            davidvanlaatum David van Laatum added a comment -
            emailext body: '${CHANGES_SINCE_LAST_SUCCESS, reverse="true", showPaths="true"}', subject: 'Test email', to: 'user.email@mycompany.com'
            

            Should work

            Show
            davidvanlaatum David van Laatum added a comment - emailext body: '${CHANGES_SINCE_LAST_SUCCESS, reverse= " true " , showPaths= " true " }' , subject: 'Test email' , to: 'user.email@mycompany.com' Should work
            Hide
            winnerwbx Andy Wang added a comment -

            Thanks David van Laatum

            I've encountered a situation here:

            Before pipeline was put into use, I used normal Freestyle job. In build actions, I used Inject environment vairables from a properties file in my workspace. The properties in the file contained the necessary variables which I would use in my email. So my email ext plugin's body part was like below:

             

            <div class="status">
               <p class="info"><font size="6">$rom_type $BuildType Build $status</font></p>
            </div>
            <div class="main round_border">
               <table>
                  <tbody>
                     <tr>$rom_type $BuildType Build $status</tr>
                     <tr>
                        <th>Build Artifact:</th>
                        <td><a  href="$ROM_URL">$ROM_URL</a></td>
                     </tr>
                  </tbody>
               </table>
            </div>
            
            

            The variables like rom_type and ROM_URL was set in the properties file.

            After migrated the job to pipeline, the variables in the properties file are failed to work.

            I've tried use withEnv and """ """ to wrap my email content. It is a temporary workaround but the  {CHANGES_SINCE_LAST_SUCCESS, reverse="true", showPaths="true"} would fail to work.

            So I tried use ''' ''' to wrap my content. The   {CHANGES_SINCE_LAST_SUCCESS, reverse="true", showPaths="true"}  worked, but variables failed. 

            What should I do to keep both work? Thank you.

             

            Show
            winnerwbx Andy Wang added a comment - Thanks David van Laatum I've encountered a situation here: Before pipeline was put into use, I used normal Freestyle job. In build actions, I used Inject environment vairables from a properties file in my workspace. The properties in the file contained the necessary variables which I would use in my email. So my email ext plugin's body part was like below:   <div class= "status" > <p class= "info" ><font size= "6" >$rom_type $BuildType Build $status</font></p> </div> <div class= "main round_border" > <table> <tbody> <tr>$rom_type $BuildType Build $status</tr> <tr> <th>Build Artifact:</th> <td><a href= "$ROM_URL" >$ROM_URL</a></td> </tr> </tbody> </table> </div> The variables like rom_type and ROM_URL was set in the properties file. After migrated the job to pipeline, the variables in the properties file are failed to work. I've tried use withEnv and """ """ to wrap my email content. It is a temporary workaround but the   {CHANGES_SINCE_LAST_SUCCESS, reverse="true", showPaths="true"}  would fail to work. So I tried use ''' ''' to wrap my content. The    {CHANGES_SINCE_LAST_SUCCESS, reverse="true", showPaths="true"}   worked, but variables failed.  What should I do to keep both work? Thank you.  
            Hide
            davidvanlaatum David van Laatum added a comment -

            So are you saying you'r using recursive expansion or are you saying withEnv breaks CHANGES_SINCE_LAST_SUCCESS?

            Show
            davidvanlaatum David van Laatum added a comment - So are you saying you'r using recursive expansion or are you saying withEnv breaks  CHANGES_SINCE_LAST_SUCCESS?

              People

              • Assignee:
                davidvanlaatum David van Laatum
                Reporter:
                bargemayur05 Mayur Barge
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: