I'm creating a MultipleCustomFieldType type, is working ok, but I'm trying to get the options of the customfield with the method getOptions(String key, FieldConfig config, JiraContextNode contextNode) the same way that the class 'EditCustomFieldOptions' of JIRA does, in that class they used this to get the options:
'options = getCustomField().getOptions(selectedParentOptionId != null ? selectedParentOptionId.toString() : null, getFieldConfig(), null);'
As you can see, they used the method getOptions of a customfield with the associated fieldConfig and a JiraContextNode null, I'm doing the same thing in my method (in a class that extends 'AbstractEditConfigurationItemAction', same class that 'EditCustomFieldOptions' extends ), but I always get a null value for the options, somebody knows why? And yes, the associated field has options configured.
Thank you for your reply.
I think, this code would be useful for you
CustomField cf = ComponentManager.getInstance().getCustomFieldManager() .getCustomFieldObject(getCfid()); cftype = CFType.STANDARD_OPTION_SELECT; FieldConfigScheme scheme = Utils.getSchemeObjectForContext(cf); @SuppressWarnings("rawtypes") Map configs = scheme.getConfigsByConfig(); if (configs != null && !configs.isEmpty()) { Set<Object> configsKeys = configs.keySet(); for (Object conf : configsKeys) { if (conf instanceof FieldConfig) { Options options = optionsManager .getOptions((FieldConfig) conf); if (options != null) { if (cfValues == null) { cfValues = new LinkedHashMap<Option, Object>( options.size()); } for (int i = 0; i < options.size(); i++) { Option option = options.get(i); cfValues.put(option, null); } } } } }
Atlassian Government Cloud has achieved FedRAMP Authorization at the Moderate level! Join our webinar to learn how you can accelerate mission success and move work forward faster in cloud, all while ensuring your critical data is secure.
Register NowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.