I am hoping to use a Groovy script that generates a list of jobs on a Jenkins instance as a build parameter. The script works in Jenkins' Script Console:

but does not work in the job:

I get the same result if I import any of jenkins.*, jenkins.model.*, hudson.*, or hudson.model.* into the script, as referenced in the Script Console.
When I try to test the script in Configure, I am unable to with or without using the Groovy Sandbox. What am I missing? Thanks in advance.

0
votes