Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Extracting a list of issues associated with a specific EPIC in JIRA Rest API

Viktoras Valiokas
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
November 8, 2021

Hi,

I was following a flow where I am trying to access a specific EPIC and then all of the tickets associated with that EPIC.

General EPIC information URL: https://{COMPANY_NAME}.atlassian.net/rest/agile/1.0/epic/{EPIC_KEY}

All issues associated with that EPIC URL: https://{COMPANY_NAME}.atlassian.net/rest/agile/1.0/epic/{EPIC_KEY}/issue

In both instances I received an error message: 

{"errorMessages":["The request contains a next-gen issue. This operation cant add next-gen issues to epics. To add a next-gen issue to an epic, use the Edit issue operation and set the parent property (i.e., `\"parent\":{\"key\":\"PROJ-123\"}` where `PROJ-123` has an issue type at level one of the issue type hierarchy). See <a href=\"https://developer.atlassian.com/cloud/jira/platform/rest/v2/\"> developer.atlassian.com </a> for more details."],"errors":{}}

This error does not occur with other projects.

 

The only difference that I noticed between projects that work and do not work is that Team-Managed Projects do not work and Company-Managed Projects work.

 

Has any one else experience this? 

1 answer

1 accepted

1 vote
Answer accepted
Matthias Gaiser _K15t_
Community Champion
November 8, 2021

Hi @Viktoras Valiokas

based on the REST API documentation, you can't use the API you've mentioned for team-managed projects:

Note: If you are querying a next-gen project, do not use this operation. Instead, search for issues that belong to an epic by using the Search for issues using JQL operation in the Jira platform REST API. Build your JQL query using the parent clause. For more information on the parent JQL field, see Advanced searching.

As recommended here, you should rather use the search endpoint and provide a JQL which filters for the parent (your epic). A possible JQL would then look like 

parent = EPIC_KEY

where EPIC_KEY is your issue key.

Cheers,
Matthias.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events