Merging a pull-request without specifying a body overwrites close_source_branch value

Issue #17883 new
Mark Tarry
created an issue

When merging a pull-request, via the Bitbucket REST API, if no body is provided then the original close_source_branch value (on the PR) is both ignored, and overwritten.

According to the API documentation:

close_source_branch boolean Whether the source branch should be deleted. If this is not provided, we fallback to the value used when the pull request was created, which defaults to False*

Steps to replicate

  • Create a pull-request, and specify close_source_branch
{   ...
    "close_source_branch": true
  • Retrieve the pull request - confirm that close_source_branch is still true
  • Merge the PR, without a request body
  • Retrieve the pull request

Expected: close_source_branch is still true, and the source branch was closed after the merge was completed

Actual: close_source_branch is overwritten to be false, and the source branch remains open after the merge was completed

Comments (1)

  1. Mark Tarry reporter


    I've confirmed that if the merge request contains a body - which repeats the original close_source_branch value - then the PR works as expected.

        "close_source_branch": true
  2. Log in to comment