I am in admin group of my team, but when I am trying to get list of all repositories using this api:
curl --user user:password https://api.bitbucket.org/2.0/repositories/team?q='project.key="JG"' | jq '.values[].name' | tr -d '"'
It is not getting all list of repositories in this project , how to get list of all repositories in a projectcreated by any team member?
Hi @kswati ,
The endpoint you are calling (/2.0/repositories/team) seems to be unavailable, at least based on https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories
You could call /2.0/teams/{username}/projects/{project_key} as described in https://developer.atlassian.com/bitbucket/api/2/reference/resource/teams/%7Busername%7D/projects/%7Bproject_key%7D
teams
{username}
projects
{project_key}
Kind regards,
Rafael
The api command I have mentioned above are getting list of some repo in one project not all repositories even with admin user dont know why, but the one you are mentioning is not fetching or retrieving any list of repositories in a project.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @kswati ,
Sorry for the misunderstanding. The REST API endpoint you are calling, where it says "team", is the actual {username} given to the team, so yes, that endpoint can be used.
The endpoint you are calling should return a paginated list of all repositories owned by the specified account or UUID, and you could get the result based on the authenticated user's role.
E.g. with ?role=contributor
, only those repositories that the authenticated user has write access to are returned (this includes any repo the user is an admin on, as that implies write access), and the role accepts any of the values below:
Since you mentioned you are unable to view all repositories, how many results are you getting when consuming the REST API endpoint? How many pages are in the response?
Kind regards,
Rafael
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.