From any given non-epic issue, the JIRA UI allows the user to "Add to Epic," and is presented with a drop-down containing a list of existing Epics to link to. In case one has already been chosen, the user is able to change it via a similar menu.
So where is this functionality in the API?
The closest I've been able to find is `/rest/api/2/issueLink`
https://docs.atlassian.com/software/jira/docs/api/REST/6.4.9/#d2e1577
This successfully links two issues in terms of "contains" or "blocks" or "duplicate," but does not establish it as child issue, the way linking an Epic does.
Furthermore, linked issues and child issues are displayed separately on the UI:
So how do I create child issues (ie link Epic to issue) via the API?
Hello,
You should use the move issues to epic rest call:
Thank you Alexey! That seems to be the right place for what I am looking to do.
Looking further at the docs, i see the functions are based on two separate APIs
I'm still new to the JIRA API, and unclear on the distinction between the two.
I have no problem executing the functions on /rest/api/2/
But with /rest/agile/1.0/ (including "move issues to epic") I am getting:
"The requested epic cannot be viewed because it either does not exist or you do not have permission to view it."
I created the project, the board, the epic, so there is no reason why my access should be restricted. It is a private project, though. Could that be why?
Are there extra or separate authentications steps I need to take to get my token to work? Or some admin somewhere need to grant me permissions?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You should use /rest/agile/1.0/epic/{epicIdOrKey}/issue.
rest/agile/1.0 is for jira software
rest/api/2/ for jira core
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
OK thanks. But, when using /rest/agile/1.0/epic/{epicIdOrKey}/issue, I am still stuck on this:
"The requested epic cannot be viewed because it either does not exist or you do not have permission to view it."
I wonder if there are project or board permissions I can tweak...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
FYI my project is Next-gen. Perhaps this is a known issue?
https://jira.atlassian.com/browse/JSWCLOUD-17305
There appear to be some recent comments (last month) indicating it is still broken.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That is right. Next-gen projects can not use this Rest Api. I do not know of any public Rest Api available for next-gen projects yet.
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.