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

Default pre-send script variable gets expanded inside the job confguration


      I have a groovy script set in the global configuration for this email-ext plugin as a "Default Pre-send Script". Set it up as: ${SCRIPT, template="scan-email.groovy"}

      I add this script to my job configurations as: $DEFAULT_PRESEND_SCRIPT in the field "Pre-send Script"

      The script will get called at the appropriate time when the job runs. But after the job has run, inside the jobs configuration, there will no longer be the $DEFAULT_PRESEND_SCRIPT I originally entered. That field will contain the scripts contents. Aka, it expanded the $DEFAULT_PRESEND_SCRIPT variable with the content of the script.

      Now, a setup like this will still work, but if I happen to edit this script, this job will not get the most recent changes I made to that script as it will just continue to use what is entered in its configuration.

      Expected behavior:
      I would have expected that $DEFAULT_PRESEND_SCRIPT stays as it is inside the jobs configuration. Pretty much like $DEFAULT_CONTENT does.

      Please find attached a sample job configuration and notice the difference before and after that job has run.

            slide_o_mix Alex Earl
            maccer Mac Cer
            0 Vote for this issue
            3 Start watching this issue