Hey everyone, I’m working on a project that involves the JIRA REST API. I’ve been able to pull a lot of data about issues, but I’m stuck on one thing. Does anyone know if it’s possible to get the epic associated with an issue through the API?
I’ve looked through the documentation and tried a few different endpoints, but I can’t seem to find this specific piece of information. The API returns tons of details about issues, but the epic just isn’t there.
Has anyone dealt with this before? Any tips or tricks would be super helpful. Maybe there’s a special query parameter or a different endpoint I should be using?
Thanks in advance for any help!
yo, i had the same problem last week! the trick is to use the ‘epiclink’ custom field. add &fields=customfield_10014 to ur API call (assuming that’s the epic link field ID). it’ll give u the epic key. u might need to fiddle with the field ID tho, it can vary. good luck mate!
I’ve actually dealt with this exact issue in a recent project. The tricky part is that epic information isn’t included in the standard issue fields, but there’s a workaround.
You need to use the ‘fields’ parameter in your API request to explicitly ask for the epic link. Try adding ‘?fields=epic’ to your issue request URL. Something like:
GET /rest/api/2/issue/{issueKey}?fields=epic
This should return the epic key and name associated with the issue. If you’re using a library to make API calls, you might need to adjust how you’re passing parameters.
Also, keep in mind that this only works if your JIRA instance has epics enabled. If it doesn’t return what you need, double-check your project settings.
Hope this helps! Let me know if you run into any other snags.
I’ve encountered this issue before. The key is to use the ‘epiclink’ custom field in your API request. The field ID can vary, but it’s often ‘customfield_10014’. Try appending ‘?fields=customfield_10014’ to your issue request URL.
If that doesn’t work, you may need to find the correct field ID for your JIRA instance. You can do this by making a request to /rest/api/2/field and looking for the ‘Epic Link’ field in the response.
Once you have the correct field ID, your API call should look something like:
GET /rest/api/2/issue/{issueKey}?fields=customfield_10014
This should return the epic key associated with the issue. From there, you can make another API call to get more details about the epic if needed.
Remember to handle cases where an issue might not be associated with an epic.