Forums

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

JIRA Rest API not returning all subtasks

Alex Dunham November 24, 2021

Hi there,

 

I am using the JIRA rest API to get all the issues for a spirnt, using this endpoint:

 /rest/agile/1.0/sprint/{sprintId}/issue

 What I am finding is that it isn't returning all the subtasks as issues in the response.

For example, I know that there is a story with 3 subtasks, and the story and subtasks are all assigned to the same user. I want to see the total number of tickets (subtasks and stories) assigned to that user, but it is only returning the parent tickets and a select few of the subtasks.

Some subtasks are returned but not all.

The parent tickets have a subtasks field on them which allows me to see the subtasks, but not who they are assigned to as this field isn't returned in the subtasks result.

Interestingly, when I do the same search in the 'issues navigator' it returns with the same problem - what I see in those results is different to what is on the board for that sprint

 

Any help would be much appreciated, thank you in advance!

1 answer

1 accepted

0 votes
Answer accepted
Earl McCutcheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 30, 2021

Hello @Alex Dunham ,

There are a few things that could be occurring here, and If you cannot see some of the issues via the UI in the issue navigator or In the returned data from the API call I would suspect that the issue is somewhere at the permission level as the issue navigator and the API will operate the same permissions wise, noting as covered in the API docs for Get issues for sprint:

Returns all issues in a sprint, for a given sprint ID. This only includes issues that the user has permission to view. By default, the returned issues are ordered by rank.

And since you can see some of the issues but not others first check if the board's filter is pulling in issues from multiple projects, and if so that you have a minimum of Browse Project permissions for all the projects returned by the boards filter.  

Another issue you may be running into with multiple projects in the filter is if the filter is Pulling in a Company Managed and a Team Managed project, noting in the following Bug that it mentions "Next-Gen" project types, where Next-Gen was rebranded to Team managed but the behavior holds true to Team managed projects that the subtasks are not found in the JQL search OR the API when searching in a Team managed project filtered by sprint:

If no Team managed projects are associated, and you can verify that you do have browse project permissions on all projects or that only a single project is present then check if there is possibly an Issue level Security Scheme in place with something like Only the assignee or reporter can see the issue or possibly restricted to a project role of group you are not associated to.

Hope this helps and please let me know what you find.

Regards,
Earl

Alex Dunham November 30, 2021

Hi Earl,

Looking at your suggestions I can confirm that:

  1. I do have permission to see the subtasks as I can see them on the Board, just not in the issue navigator/API when filtering by sprint.
  2. We are using next-gen for our board.
  3.  I can see some of the subtasks are being returned in the main response, but only a few, not all of them. 
  4. I can see the subtasks when I remove the sprint filter and don't ask to show only subtasks (i.e. show all tickets)
    1. interestingly, when I remove the sprint filter, the subtasks that I can now see (but that were not there when filtering by sprint) the sprint field is definitely filled in with the correct sprint number.

I'm thinking it might be because we are using next-gen, but that doesn't explain why I can see a handful of the subtasks but not all of them.

 

Thanks for your help so far, and please let me know if you have any other ideas.

 

Thanks,

Alex

Earl McCutcheon
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
December 6, 2021

Hello @Alex Dunham ,

Unfortunately, there is no workaround to the bug at this time, and passing the Sprint variable into a JQL filter query or as an API variable will obfuscate the subtasks when using a Team managed (Previously Next-Gen) Project is used as the issue source location, as covered in the BUG report JSWCLOUD-18394.

I have already linked this request to the bug for some additional tracking on our end but also make sure to click the "This affects my team" option on the bug report, which helps us in prioritizations efforts for future bug fixes as covered in the Atlassian Cloud Bug Fix Policy 

Regards,
Earl

Alex Dunham December 8, 2021

Hi @Earl McCutcheon

Thanks for your reply. I'm hoping this bug will get some traction soon - seems like a lot of people are impacted by it, and that is has been around for at least 2 years now. Looking at your bug fix policy, should the priority on this at least be medium, not low? Looks like the policy states that low priority is for small issues like cosmetic issues, and medium is for when some searches fail (which this definitely meets the criteria for), among other things. I would even put it as High, since there isn't a good workaround for it.

 

Thanks,

 

Alex

Like Earl McCutcheon likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events