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

Bad Request when merging pull request with Bitbucket API 2.0

Dean Kinane March 31, 2019

I've tried several different formats for the JSON body of the request but no matter what I try I get a 400 bad request response.

I'm basing my request off the official documentation here:
https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Busername%7D/%7Brepo_slug%7D/pullrequests/%7Bpull_request_id%7D/merge

I've also posted a ticket on Stack Overflow with some code examples:
https://stackoverflow.com/questions/55435975/bad-request-when-merging-pull-request-with-bitbucket-api-2-0

I've had no issues with creating branches and pull requests, the API docs are quite clear. However for some reason the merge is just not working.


Would greatly appreciate some help as I'm completely stuck.

 

EDIT:

So I have discovered that the API will return a bad request if the pull request can't be merged due to conflicts. Is this intended behavior? Is there a correct way to check for conflicts with the API before attempting to merge the PR?

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events