Forums

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

Retrieve list of repositories within a project from the api

Tran Tien dung
Contributor
August 8, 2019

Hi everyone,

As this issues , I found a workaround to get a list of repositories base on project key. However it return too much information while I only want to get a list of repository name.

Any idea?

Thanks.

1 answer

1 accepted

1 vote
Answer accepted
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 9, 2019

Hello @Tran Tien dung,

As far as I know, that's not a workaround but the right way to fetch repositories in a project. To request just their names you can use partial response feature, in your case by adding fields=values.name parameter to the query, so for an example in the linked ticket this would be:

https://api.bitbucket.org/2.0/repositories/abhintestteam?q\=%27project.key="PROJ"%27&fields=values.name

{
values: [
{
name: "test"
},
{
name: "repoinsecondproject"
}
]
}

Let me know if you have any questions.

Cheers,
Daniil

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events