Reputation: 267
I'm using Active Choices Parameter plugins.
It works well but it doesn't work when triggered by 'Build Triggers' - Build periodically.
When running by 'Build periodically',
I expected the value of SEASON is 'spring' and FRUIT is 'apple'.
I think that the 'SEASON' variable isn't recognized in Groovy script.
What should I check?
This is started by Build Triggers:
Upvotes: 2
Views: 1553
Reputation: 267
According to https://github.com/biouno/uno-choice-plugin/#known-limitations,
the parameters are supposed to be handled only by humans, and at the moment do not work when the job is triggered by plug-ins, API or scripts.
So, I did workaround using a default value:
try {
if ( SEASON == "spring" ) {
return [ "apple" ]
} else if ( SEASON == "summer" ) {
return [ "banana" ]
} else {
return [ "cherry" ]
}
} catch (e) { /* if variable is missing, return the default value */
return [ "apple" ]
}
Upvotes: 1