The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Why does /2.0/repositories/{}/{}/refs/branches fail to return all branches

markhamlin
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!
February 27, 2020

I have a private repo on Bitbucket Cloud with 7 branches.  A call to the API returns all but one.  I have tried fiddling with pagsize  and pagelength with no success.  Are there any known problems or restrictions with this endpoint? 

https://api.bitbucket.org/2.0/repositories/{myteam}/{repo}/refs/branches

 

Or is there an alternative endpoint I should be using?

 

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 27, 2020

Hello @markhamlin ,

Welcome to the Community.

The endpoint you refer to is the right one to list all branches of your repository. 

Do you see all 7 branches in Bitbucket's UI, e.g. here:

https://bitbucket.org/<workspace>/<repository_slug>/branches/?status=all

If not, how did you count those 7 branches – maybe one of them is not pushed to Bitbucket and only exists on your local working copy?

If you believe there's an issue, please open a support case with us and point to the repository in question so that we can take a look.

Hope this helps.

Cheers,
Daniil

markhamlin
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!
February 28, 2020

I was counting remotes under the origin section in Sourcetree.  A look directly on the portal and a fresh clone both revealed the missing branch had been closed, so no missing branches after all, API working properly.  Thanks for your help. 

TAGS
AUG Leaders

Atlassian Community Events