Custom cascading select not showing in view issue

157 Views Asked by At

I've developed a custom field inheriting from CascadingSelectCFType. The field (two select lists, actually) shows correctly with all the right options and I am able to save an issue. But when I view the issue the field won't show and in the "Where is my field?" menu it says: "The field 'Item' does not have value for issue INC-2 and will not be displayed on the view issue page. Set value for that field so that it shows up." Does anyone know why the value is not being saved? Here is my code:

@Override
public Map<String, Object> getVelocityParameters(Issue issue, CustomField customField, FieldLayoutItem fieldLayoutItem )
{
    Map<String, Object> result = super.getVelocityParameters( issue, customField, fieldLayoutItem );
    FieldConfig fieldConfig = customField.getRelevantConfig(issue);
    optionsManager.removeCustomFieldOptions(customField);
    String[][] items = getItemsFromDatabase();
    Option option = optionsManager.createOption(fieldConfig, null, new Long(0), "parent1");
    createOptions(fieldConfig, option.getOptionId(), items[0]);
    option = optionsManager.createOption(fieldConfig, null, new Long(1), "parent2");
    createOptions(fieldConfig, option.getOptionId(), items[1]);
    return result;
}

Thanks in advance!

0

There are 0 best solutions below