Forums

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

how to set mainbranch in bitbucket via api v2

shigapov March 27, 2019

I connect to the question, I need to periodically create new branches and change main branch

but I can not appoint main branch

this action is not mentioned in the documentation

this:

https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D#put

not working, I send

{'mainbranch':{
'type': 'branch',
'name': 'branch_name'}
}

and https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/src

not working, I send

{'parents': 'master', 'branch': 'branch_name'}

 

3 answers

2 votes
Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 1, 2019

Hello Денис

With the v2 API being so new we have noticed a few people asking the same. This short answer if you can make modifications to the main branch within the v2 API is no. The longer answer is there are feature requests and there is more to come within the v2 API in the future. With the changes spawned from GDPR, there is work that needs to be done beforehand. There is a feature request I would suggest you vote and watch to receive updates on its status. You may find this request at Issue #13306.

I hope this proves helpful and helps to clarify what is possible within the v2 API.

Regards,
Stephen Sifers

shigapov April 2, 2019

I understand everything, but the task has been hanging since 2016, how many votes do you need to solve this problem?

Stephen Sifers
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 2, 2019

Hello Денис,

Feature requests don’t always come down to votes themselves, there are other factors which may cause one feature to move to production and other features to have to wait. The best explanation of how new features get approved is within the Implementation of New Features Policy. This policy explains all of what is evaluated when a new feature gets approved.

I hope this is helpful in explaining what is needed to approve a feature request.

Regards,
Stephen Sifers

Chris Raver
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!
March 29, 2021

@Stephen Sifers a year later and this hasn't been prioritized or worked on. what gives?

Nadeem Shahbaz
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!
May 24, 2022

so almost a year again and yet feature is not implemented. What it will take to prioritize this feature, if voting doesn't play a role ?

Like # people like this
0 votes
Kevin De Notariis
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!
December 30, 2024

This is unbelievable, how long could this actually take? How do you, Atlassian, think that it is ok to not have this feature as an API?

Default branch is still master while all the world has moved to main.. and to update that we need to manually change it in the console? Crazy.

5 Years has passed and this is still hanging???

0 votes
ccenvcvb
Contributor
December 6, 2024

I need to update 19 repos,
each update requires

  • 1 click to open the repo
  • 1 click to select settings
  • 1 click to get to details
  • 1 click to get advanced
  • 1 opening drop to to select branch
  • scrolling down to get the save button
  • clicking the save button
  • closing the window

thank you for letting me waste my time by not providing an automated solution

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events