Forums

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

How can I set this option to delete source branch on a pull request via API?

Chris Fouts April 7, 2025

Atlassian finally provided an option to set source branch deletion when a pull request is created. Instead of pointing-and-clicking the option for each of our repos (a lot of them), how can I set it via API? The option is on this page, on the section Delete source branch by default

 

https://bitbucket.org/<workspace>/<repo>/admin/branching-model

 

1 answer

0 votes
Syahrul
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
April 8, 2025

G'day, @Chris Fouts 

I believe we do have an API endpoint to update this config at:

Update the branching model config for a repository 

This may not be updated, but you just need the default_branch_deletion flag to be true for turning on or false for turning off:

{
"default_branch_deletion": "false"
}

I hope this helps.

Regards,
Syahrul

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events