We have few single select & multi select customfield with many contexts.
Each context for different projects, with different values to choose in the select drop down.
Can someone help me to find how can i get list of all contexts of a customfield?
And after getting the list, how to check for what are the options in each context?
You can use FieldConfigSchemeManager and getConfigSchemeForField to get all the contexts
Then OptionsManager and getOptions to get the options in each of the Configs.
For example, in groovy:
def cf = ComponentAccessor.customFieldManager.getCustomFieldObjectByName('Severity')
For the Java API I would start at a page such as
and check in actions.xml source file for the class that is behind that URL. Then in that class and the related jsp file, look for the Manager object that they iterate over to find each context
That lead me to the class ConfigureCustomField.java and the method getConfigs, which has schemeManager.getConfigSchemesForField(customField);
Hi @Nir Haimov
On my side, I am able to get every allowed values using API.
For instance, by reaching this URL : https://xxx/jra/rest/api/latest/issue/createmeta?projectKeys=MyProject&issuetypeNames=Test&expand=projects.issuetypes.fields
I get this response :
You may see the highlighted lines: there are the allowed values for the customfield_11110.
Hope it helps !
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events