Can System Groovy Choice Parameter be defined globally?

134 views
Skip to first unread message

Victoria Kozel

unread,
Apr 25, 2017, 7:05:35 PM4/25/17
to Jenkins Users
I need to define same System Groovy Choice Parameter in multiple Jenkins jobs. I wonder if there is a way to avoid copying the script in all those jobs, and maybe define the script as a global parameter just once - same way as Global Choice Parameter from same plugin is defined. If you have an answer or an idea please share :)

Thank you!!
Vicki

Victor Martinez

unread,
Apr 26, 2017, 6:00:38 PM4/26/17
to Jenkins Users
Hi there,

I don't know what plugin you are using exactly. There are different approaches as far as I see:

1) https://wiki.jenkins-ci.org/display/JENKINS/Active+Choices+Plugin plugin supports the scriptler plugin, that's another way of centralising those scripts.

2) if you are tied to that particular Groovy Choice Parameter then by storing those scripts in the master filesystem and

http://stackoverflow.com/questions/9004303/load-script-from-groovy-script
b) using the 'evaluate' method as suggested 


If I recall correctly I used to use the evaluate function a few years ago:

I hope it helps 
Reply all
Reply to author
Forward
0 new messages