Retrieve user stories added to Epic using REST API JQL search
Platform Notice: Cloud and Data Center - This article applies equally to both cloud and data center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
Suggested solution utilizes /rest/api/2/search
endpoint to run JQL query "Epic Link" = <your_epic_issue_key>
Solution
Steps
The steps below are meant for older Jira versions.
Recent versions should be able to use the custom field name ("Epic Link") directly in the REST's JQL without needed to find the Custom field ID.
In order to retrieve the user stories under the Epic using REST API JQL search, please follow the steps below:
1. Figure out Epic Link custom field ID:
(Jira Server and Data Center) Go to Administration (⚙) > Issues > Custom Fields, select 'View' in Actions and review the URL that will show you ID of the custom field.
(Jira Cloud) Go to Administration (⚙) > Issues > Custom Fields, select 'View field information' in Actions and review the URL that will show you ID of the custom field.
Alternative you could go to (Jira Cloud)Filters > Advanced Issue Search or (Jira Server and Data Center) Issues > Search for issues and switch to 'Advanced' search. There you could start typing the field's name and it will reveal its ID:

2. Epic Link custom field will store the parent story or Epic key. You could use the retrieved custom field ID to execute the following JQL query against /rest/api/2/search
endpoint:
1
https://<JIRA-INSTANCE-NAME>/rest/api/2/search?jql=cf[10014]=<your_epic_issue_key>
Epic * custom field IDs are not unique and could vary across different environments
Was this helpful?