Hello,
I have created a customfield and I have different methods to get the value. E.g. I have a method getValueWithId(). So the value of the customfield shows the let`s say lastName and the getValueWithId is personId, lastName. I am able to get the customfieldvalue as follows:
final CustomFieldManager customFieldManager = ComponentAccessor.getCustomFieldManager();
final CustomField customField = customFieldManager.getCustomFieldObjectByName(CONTACT_CUSTOM_FIELD_NAME);
if(customField != null) {
final Object customFieldValue = getIssueObject().getCustomFieldValue(customField);
if(customFieldValue != null && customFieldValue instanceof String) {
String newCustomFieldValue = (String)customFieldValue;
Now I want to access the customField value from a class that extends a JiraWebActionSupport. I am able to access the value, but I want to directly call the getValueWithId() method from the customField class.
It`s all working as expected, my only problem is, that I have duplicated code within the customField and the class that extends the JiraWebActionSupport.
Thank you.