Currently I am using the following piece of code to generate dynamic parameters by reading from a properties file using the 'groovy script' option in 'active choice parameter'
jenkinsURL=jenkins.model.Jenkins.instance.getRootUrl()
def propFile="build_choices.properties" //name of properties file
def propKey="test" // name of properties key
def relPropFileUrl="userContent/" // userContent/properties/
def propAddress="${jenkinsURL}${relPropFileUrl}$propFile"
def props= new Properties()
props.load(new URL(propAddress).openStream())
def choices=[]
props.get(propKey.toString()).split(",").each{
choices.add(it)
}
return choices
This is currently working in version 'ver. 2.60.3' but does not work in higher versions eg: 'ver. 2.102'. Is there a solution that works across all the versions?