Milestone API not working correctly on private projects
Summary
The following endpoints according to the docs do not return anything on private projects:
- https://docs.gitlab.com/ee/api/group_milestones.html#get-all-issues-assigned-to-a-single-milestone
- https://docs.gitlab.com/ee/api/group_milestones.html#get-all-merge-requests-assigned-to-a-single-milestone
Steps to reproduce
Install jq
as dependency to be able to get information from JSON
GITLAB_API_TOKEN="YOURTOKEN"
GROUP_ID="gitlab-org"
ACTIVE_MILESTONE_ID="$(curl --fail --silent --show-error --request GET --header "PRIVATE-TOKEN: ${GITLAB_API_TOKEN}" "https://gitlab.com/api/v4/groups/${GROUP_ID}/milestones?state=active" | jq '.[0].id')"
curl --header "PRIVATE-TOKEN: ${GITLAB_API_TOKEN}" https://gitlab.com/api/v4/groups/${GROUP_ID}/milestones/${ACTIVE_MILESTONE_ID}/issues
Above works, but when your change GROUP_ID
to a private project ID or private project urlencoded namespace it will always return an empty array even when the milestone has some issues and merge requests added to it.
Example Project
N/A
What is the current bug behavior?
API return empty array instead of the issues or merge requests attached to it
What is the expected correct behavior?
It should return the issues and merge requests
Relevant logs and/or screenshots
N/A
Output of checks
This bug happens on GitLab.com
Possible fixes
N/A