-
Bug
-
Resolution: Won't Fix
-
Major
-
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.
This is not possible, as the tokenmacros can only be expanded in the context of a build. I updated the documentation to make this more clear.