You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
I was wondering if anyone knows whether it's possible to identify the original special "Epic" issue type via the REST API.
I've found that it's possible to rename Epic to something else, meaning that via the API, I can't identify which issue type is the original "Epic" type.
I have tried the following APIs:
Each provides the same issue schema back:
{
"self": "https://api.atlassian.com/ex/jira/262560a0-5ce0-4e72-990e-62464cbb26e6/rest/api/3/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://jpsear1.atlassian.net/images/icons/issuetypes/epic.svg",
"name": "Renamed Epic",
"subtask": false
}
Unfortunately, there is no where to tell this is a core "Epic" type. Any ideas?
You can query fields (/rest/api/3/field) and look for fields with
schema.custom = "com.pyxis.greenhopper.jira:gh-epic-label"
Grab the field id and query its contexts (/rest/api/3/field/<fieldId>/contexts) and look for
associatedIssueTypes
Hey Thomas,
Thanks for the reply, I will give this a go as soon as I get a chance and report back!
James
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Thomas,
After getting frustrated searching for a way to do this and looking at deprecated APIs for hierarchy; am quite glad I found your answer. This method is a lifesaver. Although, I must state that https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-issue-fields/#api-rest-api-3-field-fieldid-contexts-get - the getContexts method has been marked as deprecated. :P
/riz
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, so this does not work on Next-gen projects. The getContext API always returns 10000 issue as epic but my project has it as 10002.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
As I know Greenhopper API is depricated. Agile API (https://developer.atlassian.com/cloud/jira/software/rest/intro/#introduction) is introduced instead, but i don't see method from this API that can answer on the question.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello James,
Indeed, I was not able to find any information returned in the REST API to confirm that an issue type is an Epic, however, you can use the Epic Name field to identify which issues are "real" Epics.
This would be the query to return all epic issues:
https://pettertest7.atlassian.net/rest/api/3/search?jql=%22Epic%20Name%22+is+not+empty
Additionally, you can check both links below for more details about REST APIs and search examples:
If this query does not help, please give us more information about your final goal so we can give you further options to achieve your need. :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the reply @Petter Gonçalves
Unfortunately, searching for issues filtering for the "Epic Name" field is problematic, as Jira Cloud next-gen projects don't use this and there is the possibility that the project does not contain any epic type issues yet — in which case the query will return 0 issues.
As far as I can tell, this is not possible :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello James,
I agree with you that the mentioned solution would not work if you have:
- Renamed Epic + The Epic is from a next-gen project
OR
- Renamed Epic + There is no Classic Epic issues in the instance
It's indeed a limitation of JIRA REST API. You must collect in the UI the original EPIC ID to properly return the "real Epic" through REST API, independent of its name or project type.
That been said, I would really appreciate if you could provide us more details about what kind of limitations it is causing in your scenario, so we can talk with our internal teams and further investigate if we can provide any options to meet your needs.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I am integrating an external tool with a user's Jira instance. I am giving the user the choice of how to map certain issue types. Therefore, I need to be able to identify the epic issue type. Obviously if this has been renamed, this is going to be inconsistent.
Just a quick tweak in the REST API response for issue types would be the perfect solution :)
Considering there is currently:
"subtask": false
Then, you could go as simple as:
"epic": false
Of course, I don't know the internal mechanisms and potential complications that could be lurking!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.