I’m working with the JIRA REST API and need to find out which epic a particular ticket belongs to. When I fetch ticket details through the API, I get tons of information back but I can’t seem to locate the epic association anywhere in the response. I’ve been trying different endpoints and parameters but haven’t found a way to get the parent epic data for my tickets. Has anyone figured out how to pull this information? I need to map tickets to their respective epics for reporting purposes. Any suggestions on which API endpoint or specific fields I should be looking at would be really helpful. Thanks in advance!
The epic relationship is actually stored in the issue fields but might not be immediately obvious depending on your JIRA configuration. I’ve found that using the /rest/api/2/issue/{issueKey} endpoint with proper field expansion works well. Try adding ?fields=parent,customfield_* to your request to see all custom fields at once. In my experience, the epic link is usually found under a field called something like customfield_10008 or similar, but the exact number varies by instance. What helped me was checking the field names in JIRA’s admin interface first to identify which custom field ID corresponds to “Epic Link” in our setup. Once you know the correct field ID, you can be more specific in your API calls and avoid pulling unnecessary data.
You can find the epic association for a ticket in the response by looking for specific custom fields often prefixed with customfield_. Each JIRA instance may have a different mapping, but it’s commonly customfield_10014. Look for a field containing the epic key, such as “PROJ-123”. Additionally, you might want to try using the /rest/api/2/issue/{issueKey}?expand=names endpoint to get field mappings, helping you locate the corresponding custom field for the “Epic Link”. Once retrieved, you can call /rest/api/2/issue/{epicKey} for detailed information about the epic.
i had this same issue last week! try using the search endpoint /rest/api/2/search with jql like issue = TICKET-123 and include fields=summary,issuelinks,parent. the epic connection might be under issuelinks or parent depending on how your jira is setup. worked for me after struggling with the regular issue endpoint