Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Jira Software Cloud REST API throws 404 errors on items that exist

Piotr Mierzejewski October 30, 2018

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

 

1 answer

0 votes
david
Atlassian Partner
October 30, 2018

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

Piotr Mierzejewski October 30, 2018

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).

Andrew Zibuda
Contributor
October 30, 2018

Are the tasks related to the Epic via an Epic Link field on the tasks?

david
Atlassian Partner
October 30, 2018

@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

Piotr Mierzejewski October 30, 2018

@Andrew Zibuda: I don't think so, here's what it looks like in Jira:

  1. Epic view
  2. Child view

@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. 

Andrew Zibuda
Contributor
October 30, 2018

I'm not able to view those links at work, can you upload the images here directly?

Piotr Mierzejewski October 30, 2018

@Andrew Zibuda sure!

Epic viewScreenshot 2018-10-30 16.10.42.png

 

Child viewScreenshot 2018-10-30 16.13.13.png

 

 

Thanks!

david
Atlassian Partner
October 30, 2018

@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/#/

Andrew Zibuda
Contributor
October 30, 2018

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)
Piotr Mierzejewski October 30, 2018

@Andrew Zibuda it doesn't return any results, so I think the Epic Link field isn't used in this case.

Screenshot 2018-10-30 16.47.16.png

Piotr Mierzejewski October 30, 2018

@david I created a ticket – thanks for your help!

Andrew Zibuda
Contributor
October 30, 2018

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

Piotr Mierzejewski October 30, 2018

@Andrew Zibuda

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.

Andrew Zibuda
Contributor
October 30, 2018

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!

Piotr Mierzejewski October 30, 2018

Yeah, I reported it to the support team. Thank you for your help!

david
Atlassian Partner
October 30, 2018

You welcome Piotrek, please share with us the response from Atlassian

Piotr Mierzejewski November 2, 2018

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!

david
Atlassian Partner
November 5, 2018

Great!! happy to hear that. Let's see if they fix it soon.

Suggest an answer

Log in or Sign up to answer