Hi all, I'm developing a jira plugin custom field extends SelectCFType class, and I Override the OptionsManager.getOptions() function, but when I refresh the portal, the options will be rendered repeatedly like below. Could anyone solve this?
And here's my getOptions funciton.
@Override
public Options getOptions(FieldConfig fieldConfig, JiraContextNode jiraContextNode){
try {
List<Option> options = new ArrayList<>();
IQLFacade iqlFacade = ComponentAccessor.getOSGiComponentInstanceOfType(IQLFacade.class);
String iql = "Key != \"\"";
List<ObjectBean> assets = iqlFacade.findObjects(iql);
log.debug(assets.toString());
for(ObjectBean asset : assets){
String key = asset.getObjectKey();
Integer id = asset.getId();
log.debug(key);
log.debug(id.toString());
options.add(ComponentAccessor.getOptionsManager().createOption(fieldConfig,null,Long.valueOf(id),key));
}
log.debug(options.toString());
return new OptionsImpl(options,fieldConfig,ComponentAccessor.getOptionsManager());
} catch (InsightException e) {
throw new RuntimeException(e);
}
}
Any adivce will be appreciated. Thanks in advance.