You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
How to enable “branch deletion on merge” for Bitbucket projects via REST API?
New Java and REST API methods have been added to configure Branch deletion on merge
for Project and Repository.
DeleteAfterMergeConfigurationService.deleteConfiguration(scope)
, DeleteAfterMergeConfigurationService.getConfiguration(scope)
and DeleteAfterMergeConfigurationService.setConfiguration(DeleteAfterMergeConfigurationRequest)
introduce the ability to configure Branch deletion on merge
feature.
New REST endpoints:
PROJECT
GET /rest/branch-utils/latest/projects/{key}/delete-after-merge
get if the feature is enabled for a Project.
POST /rest/branch-utils/latest/projects/{key}/delete-after-merge
enable or disable the feature for a Project.
REPOSITORY
GET /rest/branch-utils/latest/projects/{key}/repos/{slug}/delete-after-merge
get if the configuration is enabled for a Repository.
POST /rest/branch-utils/latest/projects/{key}/repos/{slug}/delete-after-merge
enable or disable the configuration for a Repository.
DELETE /rest/branch-utils/latest/projects/{key}/repos/{slug}/delete-after-merge
delete the configuration for a Repository.
In order to enable “branch deletion on merge” for Bitbucket projects via REST API, you will need to make a PUT request to the following endpoint:
/rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/branch-utils/delete-on-merge-config
In the request body, you will need to specify the following JSON:
{
"deleteOnMerge": true
}
Where {projectKey} is the key of the Bitbucket project and {repositorySlug} is the slug of the repository.
If the request is successful, the response will return a 204 status code.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
404 status code means the endpoint could not be found. Check the project key and repository slug to make sure they are correct.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.