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

Scriptler: Token macro expansion doesn't happen in "Run a script" parameters

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: Major Major
    • scriptler-plugin
    • None

      When running script via "Run a script" action (/scriptler/runScript), it turns out that values supplied to script parameters are not expanded using Token Macro plugin.

      This is highly confusing, as the docs page https://wiki.jenkins-ci.org/display/JENKINS/Scriptler+Plugin#ScriptlerPlugin-TokenMacroSupport explicitly says "as a consumer, scriptler accepts tokens in the passed arguments".

      Overall, with a freshly installed Jenkins, it is impossible to easily test and try token macro facility. After trying this and that, I finally thought that Scriptler would be my best friend for testing token macros, but turned out to be another wall to bang head against.

      So, in the end, it turns out that tokens are expanded in values for Scriptler actions specified as job's build step. Again, they are not expanded when running script directly.

      Steps to reproduce:

      1. Create a token macro handler in Scriptler itself, based on the example in docs: https://wiki.jenkins-ci.org/display/JENKINS/Scriptler+Plugin#ScriptlerPlugin-TokenMacroSupport

      2. Create another Scriptler script with just "println param", then try to run it, setting "param" argument to "${SCRIPTLER, scriptId="superscript.groovy"}"

      Expected result: date string to be printed

      Actual result: "${SCRIPTLER, scriptId="superscript.groovy"}" is printed literally.

            domi Dominik Bartholdi
            pfalcon Paul Sokolovsky
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: