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

Support for importing additional packages in scripts

XMLWordPrintable

      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

            Unassigned Unassigned
            ioannis Ioannis Moutsatsos
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: