Unable to generate pull request from command line

Ramashankar Mishra February 19, 2020

command executed successfully but no luck. Pull requests didn't get generated. Here is the command which I fired.

curl -u myUserName:myPwd -H "Content-Type: application/json" https://bitbucket.org/rest/api/1.0/projects/myProject/repos/myCore/pull-requests -X POST --data '{"title":"merge","description":"merge","fromRef":{"id":"refs/heads/testBranch","repository":{"slug":"myCore","name":null,"project":{"key":"testBranch"}}},"toRef":{"id":"refs/heads/toBranch","repository":{"slug":"myRepo","name":null,"project":{"key":"testBranch"}}}}'

1 answer

0 votes
Daniil Penkin
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 19, 2020

Hello @Ramashankar Mishra,

By the look of the URL, you're trying to use Bitbucket Server's API endpoint with Bitbucket Cloud. Unfortunately, the APIs are actually very different, here's the endpoint to create a pull request in Bitbucket Cloud:

POST /2.0/repositories/{workspace}/{repo_slug}/pullrequests

This page contains some examples of curl commands too.

Hope this helps. Let me know if you have any questions.

Cheers,
Daniil

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events