Reputation: 21359
There is jenkins
parameterized job.
And there are two properties defined
Would like to show the different list of values in Property2 based on the value selected for Property1.
Tried accessing Property1
, $Property1
, %Property1%
in Groovy Script of Property2. But, does not seem to work.
Script looks something like below
if ($Property1 == 'configuration1') {
return ['suite1','suite2', 'suite3']
} else if ($Property1 == 'configuration2') {
return ['suite3', 'suite4']
} else if ($Property1 == 'configuration3') {
return ['suite5', 'suite6']
}
Even returning simple list to Property2
also does not seem to work from Groovy Script like return ['suite1', 'suite2']
(just tried to show list of values without even checking condition). Am I missing something?
Upvotes: 2
Views: 3503
Reputation: 1375
You can try Jenkins Active Choices plugin. The parameter options can be dynamically generated from a Groovy script and can respond to changes in other job parameters.
Upvotes: 2