I have tried the following code to update the custom fields context.
CustomField field = customFieldManager.getCustomFieldObjectsByName(customField).iterator().next();
FieldConfigScheme defaultConfig = field.getConfigurationSchemes().iterator().next();
List<JiraContextNode> contexts = defaultConfig.getContexts();
List<JiraContextNode> newContexts = new ArrayList<>(contexts);
newContexts.add(projectContext);
FieldConfigSchemeManager fieldConfigSchemeManager = ComponentAccessor.getFieldConfigSchemeManager();
fieldConfigSchemeManager.updateFieldConfigScheme(defaultConfig, newContexts, field);
ComponentAccessor.getFieldManager().refresh();
But the new context does not get applied .
Online 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.