I am using the ScriptRunner Behaviour Initialzer on a text filed and want to populate it with a list of components that users can pick from. I am using this as a look up since I don't have access to any server side tools to create the data set.
I am using this script but the Team field doesn't get populated. The API call is valid and returns data from my browser.
getFieldByName("Team").convertToMultiSelect([
ajaxOptions: [
url : getBaseUrl() + "/rest/api/latest/project/GA/components",
query: true, // keep going back to the sever for each keystroke
// this information is passed to the server with each keystroke
data: [
currentJql : "project = GA ORDER BY component ASC",
label : "Select the Team"
// specify maximum number of issues to display, defaults to 10
// max : 5,
],
formatResponse: "general"
],
css: "max-width: 500px; width: 500px",
])