-
Improvement
-
Resolution: Unresolved
-
Minor
-
Scriptler v3.1, Jenkins v 2.222.1
I was caught by surprise today, when I realized that Scriptler scripts do not seem to support import statements. In fact they completely ignore them, not even raising an error when you try to import a totally bogus package.
As an example, I tried to use the hudson.util Util (Jenkins core 2.330 API)] package and its Util.rawEncode() method.
Note that the script itself works correctly from the Jenkins script console
In Scriptler script, I added an import statement for the Util package, and later tried to call it from the static class:
import hudson.util.* Util.rawEncode('/path to encode/for Artifact#34')
It failed with the error message
groovy.lang.MissingPropertyException: No such property: Util for class: Script1