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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

how to set mainbranch in bitbucket via api v2

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'}

 

1 answer

1 vote

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

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

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

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

Suggest an answer

Log in or Sign up to answer
TAGS
Community showcase
Published in Bitbucket

Calling any interview participants for Bitbucket Data Center

Hi everyone,  We are looking to learn more about development teams’ workflows and pain points, especially around DevOps, integrations, administration, scale, security, and the related challeng...

442 views 4 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you