Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

No Default branch in /api/latest/projects/projectKey}/repos response

deep_meena
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
August 7, 2024

Hi , I am using docker image to host Bitbucket server in a EC2 instance, When I am calling `api/latest/projects/projectKey}/repos` its not returning default branch in response. Even though there is default branch , I also verified using the 

/api/latest/projects/{projectKey}/repos/{repositorySlug}/default-branch, its returning the default branch.

Due to performance reasons , I can't call the second api for each repo. Please let me know why default branch is not coming in Get repos call.

 

 

1 answer

1 vote
Aman Shrivastava
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
August 12, 2024

Hi @deep_meena 

Welcome to the Atlassian community.

The Get repositories for project  endpoint doesn't actually return the default branch.
After discussing the code and documentation with the developers, we concluded that this is a bug and filed BSERV-19566 to correct the documentation.
We are truly grateful that you brought this to our attention and assisted us in making improvements to our system.

The only workaround, as stated in the BSERV-19566, is to retrieve the default branch using the Get repository default branch API. Because it's such a light API, Bitbucket performance won't be impacted if you use it serially for multiple repositories.

Regards,
Aman

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events