0

For my app I need to be able to create already merged pull requests through BitBucket API.

According to their documentation, all I need to specify is the state parameter as MERGED, however this doesn't seem to work.

When sending a request to that endpoint, with a body like this:

{
  "title": "Merged pull request",
  "source":{
      "branch":{
          "name": "branchname"
      }
  },
  "state": "MERGED"
}

the API ends up creating a branch with an OPEN state. I've also tried specifying a merge_commit as hinted here in some older documentation, however it ended in the same way.

Another option that I tried was creating an open pull request and then updating its state to MERGED both with and without specifying a merge_commit, however it didn't do anything, the API replied with a pull request with no changes.

Searching for this or related issues on the internet brought nothing but some duplicate documentation and parts of source code (defining the structure of a pull request) of tools that interact with BitBucket API, and lastly this which ended up not being the question nor the answer that I was looking for.

Is there some correct way to create an already merged pull request with BitBucket API?

0 Answers0