Is there a way to tell an issue is an Epic via the API

Greg Goodman July 26, 2016
I am getting the list of issues using the search API. I have the list of issues with  the epics inside it, by I need to identify them. In my jira instance the issues that are epics has this issuetype field:
  1. avatarId10867
  2. description"gh.issue.epic.desc"
  3. iconUrl"https://comalatechdev.atlassian.net/secure/viewavatar?size=xsmall&avatarId=10867&avatarType=issuetype"
  4. id"7"
  5. name"Epic"
  6. self"https://comalatechdev.atlassian.net/rest/api/2/issuetype/7"
  7. subtaskfalse
The problem is that I don't know if an epic has the same in all jira instances, since I have tried changing the language and the same fields now are:
  1. avatarId10867
  2. description"Creado por JIRA Software - no editar ni eliminar. Tipo de incidencia para una historia del usuario grande que debe desglosarse."
  3. iconUrl"https://comalatechdev.atlassian.net/secure/viewavatar?size=xsmall&avatarId=10867&avatarType=issuetype"
  4. id"7"
  5. name"Épica"
  6. self"https://comalatechdev.atlassian.net/rest/api/2/issuetype/7"
  7. subtaskfalse
As you see the constants are id, self, iconUrl and subtask. My question is: in all jira instances the issuetype with id 7 is epic? If not, how can I check if an issue is an epic?
Thank you in advance.

1 answer

0 votes
Robert Massaioli _Atlassian_
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 26, 2016

You can get all of the issue types: https://docs.atlassian.com/jira/REST/cloud/#api/2/issuetype-getIssueAllTypes

You can also get all of the epics for a board: https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/board/{boardId}/epic-getEpics

You can also use anything from the /epic API: https://docs.atlassian.com/jira-software/REST/cloud/#agile/1.0/epic

I hope that helps achieve your use case. Please let me know if it does not.

Greg Goodman July 26, 2016

Thanks Robert for the suggestions.

I'm not sure any of these can really help my use case. I have an issue ID and I'm trying to identify if that issue is an Epic or something else. Just having the list of issuetypes won't help as you can't tell which one is the Epic one as far as I can tell other than by Name which can change in different languages.

If it is an issue I do want to gather the contained stories so the GET /rest/agile/1.0/epic/{epicIdOrKey}/issue  call would be helpful once I know if its an epic. 

Krzysztof Kercz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 27, 2016

You can use GET /rest/agile/1.0/epic/{epicIdOrKey}. If the issue is an epic, then a success response will be returned, otherwise 404.

Niels Frederiksen September 11, 2019

@Krzysztof Kercz I am facing a similar problem, and apparently the getEpic endpoint does not work your NextGen projects.
How do I find out if an issue is an epic in a nextGen project?

Krzysztof Kercz
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
September 11, 2019

I don't think there is any straightforward way. Feel free to create a feature request in the [ACJIRA](https://ecosystem.atlassian.net/browse/ACJIRA) project for this.

Niels Frederiksen September 11, 2019

Okay thank you. I have create the following issue: https://ecosystem.atlassian.net/browse/ACJIRA-1966

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events