Problem displaying icon for Epics in Custom UI

Hi All,

I am trying to display the icon for an issue in my forge custom ui react app using an img tag. To do this I use the issue->fields->issuetype->iconUrl value for the img src prop. This works well for stories, but fails to load for epics (Chrome says blocked:csp).

Looking at source, I see that the story icon url was transformed at some point from:

https://site.atlassian.net/rest/api/2/universal_avatar/view/type/issuetype/avatar/10315?size=medium

to

https://api.atlassian.com/ex/jira/guid/rest/api/2/universal_avatar/view/type/issuetype/avatar/10315?size=medium

But the icon url for Epics does not get transformed, and is different from the story one:

https://site.atlassian.net/images/icons/issuetypes/epic.svg

Am I doing something wrong, is this a limitation in the Forge platform, and is there a workaround or another way of displaying the Issue type’s corresponding icon?

Thanks.

1 Like

Hi @Giacomo,
We ran into this as well and ended up treating the icon URL for epics as a special case:

const isEpic = jiraValue.iconUrl && jiraValue.iconUrl.endsWith("epic.svg");
const iconUrl = isEpic ? epicImageData : jiraValue.iconUrl;

where epicImageData is a base64 encoded version of the epic image.
A kludge for now…

Thanks,
Fredrik

1 Like