I have tried to use the code:
CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager();
CustomField customField = customFieldManager.getCustomFieldObject("Source");
Object customFieldValue = customFieldManager.getCustomFieldObject("customField");
System.out.println(customFieldValue);
but I'm getting an error:
java.lang.NoClassDefFoundError: com/atlassian/jira/component/ComponentAccessor
Does anyone know how to deal with this? Or a better way to access custom fields?