How to determine is issue via REST API an epic with non en_EN locale

Hi,

I have switched my language to RU in personal settings.
Now I get issues with

"issuetype": {
"self": "https://avelytchenko.atlassian.net/rest/api/2/issuetype/10000",
"id": "10000",
"description": "Подборка похожих историй, заданий и связанных с ними ошибок.",
"iconUrl": "https://avelytchenko.atlassian.net/images/icons/issuetypes/epic.svg",
"name": "Эпик",
"subtask": false
},

against English it looks like

"issuetype": {
"self": "https://avelytchenko.atlassian.net/rest/api/2/issuetype/10000",
"id": "10000",
"description": "A big user story that needs to be broken down. Created by JIRA Software - do not edit or delete.",
"iconUrl": "https://avelytchenko.atlassian.net/images/icons/issuetypes/epic.svg",
"name": "Epic",
"subtask": false
},

so I can not rely on issue.field.issuetype.name === ‘Epic’

next-gen projects have epics also, so I can not rely on stored array of issuetype ids because projects can be added any time.

So how to explicitly determine is issue an epic?

Thank you.

3 Likes

Hi Avelit,

For next-gen boards you can use the new hierarchy API:
https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-project-projectId-hierarchy-get

That response has 3 levels. 0 is the base level for bug story etc, -1 is subtasks and 1 is epics. It looks like the new API is designed for arbitrary hierarchies but currently you can just look for the issue type at level 1.

For classic projects on Jira Cloud there is no public API to determine the Epic issue type. To determine the Epic issue type we try 3 things in this order.

  1. From the create issue metadata endpoint get the list of issue types and their configured fields. https://developer.atlassian.com/cloud/jira/platform/rest/v2/#api-rest-api-2-issue-createmeta-get

From the list of fields look for the Epic Name field as it’s only available on Epics and has a well known schema: “com.pyxis.greenhopper.jira:gh-epic-label”. If the user has removed the Epic Name from their screen configuration this will fail.

  1. Ask for the first epic on their Agile board and look at the issue type. This method only works if you have a board id and the user already has epics on that board.
    https://developer.atlassian.com/cloud/jira/software/rest/#api-rest-agile-1-0-board-boardId-epic-get

  2. Look for an issue type called “Epic” this will obviously only work on English instances that haven’t renamed their issue type.

This is just a heuristic and occasionally none of those mechanisms work. In that case we display an error message and ask the user to add the “Epic Name” field to their screen configuration or contact us for support.

Hi jkells,

3 steps and contact support looks a little bit complicated and not exact.
Cloud have 22 languages and Epic has same name at EN, DE, FR. So it is possible to create an list of names and check if it contains issue.field.issuetype.name. It seems more simple and more exact.

[‘에픽’, ‘Эпик’, ‘Eposz’, ‘Episk’, ‘Epika’, ‘Epik’, ‘Épico’, ‘长篇故事’, ‘エピック’, ‘Eepos’, ‘Epos’, ‘Epic’]

Thank you.

Hi @avelit,
thank you for expressing your interest in this feature.
This is currently being tracked by https://ecosystem.atlassian.net/browse/ACJIRA-1309 .
We don’t currently have an ETA for this, but we can prioritise it if there is interest in it.
Simone

HI @srusso,

It would be great.

Thank you.

@avelit
Our experience has been that users rename the Epic Issue Type so matching on the issue type name is our final fallback but YMMV.

1 Like