I am having a json file as
{ "data": [{"location" : "EU",
"env": ["DEV", "PRD", "UAT"]},
{"location" : "US",
"env": ["DEV", "PRD", "UAT", "DR", "VD"]}
]}
I am trying below groovy script to have Active choice reactive parameter
import groovy.json.JsonSlurperClassic
List Locations = []
def file_data = new File('<above json file path>').text
def jsonParser = new JsonSlurperClassic()
def data = jsonParser().parseText(file_data)
for (details in data.data){
Locations.add(details.location)
}
return Locations
I am getting Locations correctly as Parameters, however, I want to use the same file again and try to return environments based on Location using the Active Choice Reactive parameter.
I tried multiple options but did not get any luck. Any help will be much appreciated.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…