It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Bad Request when merging pull request with Bitbucket API 2.0 Edited

Dean Kinane Mar 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
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder

...ipe.sh :  #!/bin/bash source "$(dirname "$0")/common.sh" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

1,570 views 1 18
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you