1

I currently have my groovy script in workspace under sdkTools/tools/at-jenkins/helloWorld.groovy

I dont know in what form this file path needs to be enter image description here

I have tried:

$WORKSPACE/sdkTools/tools.....

sdkTools/tools...

/sdkTools/tools...

../helloWorld.groovy

None worked. Script contains simple return of HelloWorld text. I tried putting same script into "Groovy Script" option and it worked.

return "hello world"

enter image description here

As you can see nothing shows on Dialog_test parameter if groovy file is selected.. But if I hardcore script I get hello world there.

Any help is much appreciated

1 Answers1

0

You need to use a full path. It won't work for the first time because the script needs to be approved first. However, I recommend using Scriptler plugin, so the scripts are approved straight away. Scriptler creates scripts in /var/lib/jenkins/scriptler/scripts, so if you e.g. create test script, you need to use its absolute path with extension in your Extended Choice Parameter configuration - /var/lib/jenkins/scriptler/scripts/tets.groovy, so it looks like e.g.: enter image description here

Krzysztof Skrzynecki
  • 2,345
  • 27
  • 39