Hi,
I created a Rest end point which brings data from external API.
I need to set the values from rest end point as options to existing single select field by overriding the default options. Below is Behaviour Script
def testList = getFieldByName("Type List")
def restOptions = get("/rest/scriptrunner/latest/custom/fetchValues")
.asObject(List)
.body.findAll{(it as Map).Items} as List<Map>
testList.setFieldOptions(restOptions)
RestEnd Point defined under script runner returns following:
{"items":[{"value":"abcd","html":"abcd","label":"abcd"},{"value":"xyz","html":"xyz","label":"xyz"}],"total":0,"footer":"Choose Types...)"} I'm not sure what is wrong doing here and how to call rest end point and get the data and set as options.