The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Bad Request when merging pull request with Bitbucket API 2.0

Dean Kinane
Contributor
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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

TAGS
AUG Leaders

Atlassian Community Events