Hey,
I've been experimenting with Jira Software Cloud REST API a bit lately.
When I query '/rest/agile/1.0/board/1/epic' I get all my epics displayed correctly. They all contain 'self' URL, e.g. '/rest/agile/1.0/epic/10000' (alongside id, key, and summary). When I try to access that URL I get the following response:
{
"errorMessages": [
"The requested epic cannot be viewed because it either does not exist or you do not have permission to view it."
],
"errors": {}
}
The epic definitely exists and I do have access to it though, because the previous ('/board') query displayed it just fine! I get the same response when I try to access issues in the epic ('/rest/agile/1.0/epic/10000/issue').
Is there anything I missed here? According to the documentation both endpoints require same permissions scope, so if one of them works the other should too.
I'll be grateful for any tips!
Cheers,
Piotr
Hi @Piotr Mierzejewski if you want to get the info from an Epic better to use regular GET for an issue (as an epic is an issue itself)
/rest/api/3/issue/{issueIdOrKey}
Cheers,
David
Hi @david! Thanks for the tip! I checked that approach and it seems that this endpoint doesn't return tasks that belong to the epic (which is what I'm trying to get from the API).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Are the tasks related to the Epic via an Epic Link field on the tasks?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Piotr Mierzejewski I've reproduced your behaviour and it's a bit odd as you can see the Epic in the endpoint before (boards). It seems that is a bug from Atlassian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Andrew Zibuda: I don't think so, here's what it looks like in Jira:
@david: why do you think it's a bug that I see the Epics in board endpoint? Do you think they should be accessible from the API at all? I agree that it's quite inconsistent behaviour though, I suspected it to be a bug too.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I'm not able to view those links at work, can you upload the images here directly?
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.
@Piotr Mierzejewski I've asked my colleagues and they think is a bug too, as we are testing being a Jira admin (full access and scopes) and still, does't get the Epic details.
I recommend to raise a ticket in the Support site explaining the situation https://support.atlassian.com/contact/#/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Alright so I don't see any Epic Link field like we have but if you can find some linking field you can do a GET search based on that, this is the way we get all issues in an Epic:
get("/rest/api/2/search")
.queryString("jql", "\"Epic Link\" = \"$epicKey\"")
.asObject(Map)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Andrew Zibuda it doesn't return any results, so I think the Epic Link field isn't used in this case.
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.
You could try just getting all the fields of a child issue and seeing if any Link it back to the Epic in a similar way and search based on that instead. Something like this -
def result = get('/rest/api/2/issue/' + issueKey)
Failing that, I'm not sure where else to go aside from addressing the bug that David mentioned
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The only field that seems like it could potentially contain some kind of link is this:
"customfield_10017": {
"hasEpicLinkFieldDependency": false,
"showField": false,
"nonEditableReason": {
"reason": "PLUGIN_LICENSE_ERROR",
"message": "Portfolio for Jira must be licensed for the Parent Link to be available."
}
},
According to Jira it's 'Parent Link'.
'Epic Link' is customfield_10014 and it's null, unfortunately.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Alright, so it seems like, unless you want to start requiring Epic Link, you'll just have to try pursuing the bug David mentioned. Sorry!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yeah, I reported it to the support team. Thank you for your help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Update: Atlassian admitted that this is a bug on their part.
I've tested the agile rest calls against your KIVU project in Jira and I can replicate the error from our end. For a quick background, we are currently releasing a new type of project called the Next-gen project. This new feature set is still a work in progress and our product teams are working hard to make this as powerful as the classic Jira project. More information on what is to come can be found on the Next Gen Software Project Roadmap.
Epics have just been recently added to this Next Gen projects and it seems like we found a bug for the agile rest api. I filed that bug and it can be tracked via JRACLOUD-70970. Please add yourself as a watcher to get further updates on the bug ticket. If you are interested to know how our developers prioritize bugs fixes, please view Atlassian Bug Fixing Policy.
I do apologize for the inconvenience. I confirmed that the agile rest calls are working as expected on classic agile projects. I would suggest to use that for now to take advantage of the full rest api capabilities of agile projects. More information on migration issues from the Next gen project to a classic project can be found on this documentation.
Go to the Jira Projects page
Create a new Classic Project (Scrum)
Set up the project according to your requirements.
Open the Jira Search for KIVU
In the top-right corner, select more (•••) > Bulk change all.
Move the issues from KIVU project to the new classic scrum project.
Try the agile rest api call against the classic board.
After switching to the classic kind of project I was able to get the information from the API that @david suggested in his very first response (via custom field).
Thank you both for your help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.