Obtaining Epic Color programmatically

I’m trying programmatically obtain value from Epic Colour customField, but I’m failing miserably

I’ve tried using:

Issue epic; //100% sure this issue is an Epic and has selected Epic Colour
CustomField cf_epicColour; //100% sure Epic Colour cf

epic.getCustomFieldValue(cf_epicColour); //Returns null
cf_epicColour.getValue(epic); //Also returns null

And nulls every time when I do so. (when at the same time, I can clearly see this values are set - either chcecking it via REST API or searching with visible Epic Colour column)


Unfortunately I can not use REST APi call, that’s why I want to get this field value via CustomField class or any diffrent class avalaible (https://docs.atlassian.com/software/jira/docs/api/7.13.1/index.html?)

Does anyone has any ideas how to get this value?

It seems like I had just error in my code before, because it’s working for my right now.

Here’s my topic on ‘classic’ community with the same question: https://community.atlassian.com/t5/Jira-questions/Programmatically-obtain-Epic-Colour/qaq-p/1380570