The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to Update a custom field's context.

DonPerera
Contributor
September 19, 2019

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 .

0 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

TAGS
AUG Leaders

Atlassian Community Events