I'm trying to add pull request support to my Git client Working Copy and having trouble pull request is between forks. In these tries I'm authenticated as user=workingcopy that has pullrequest privileges.
Specifically I try to make a PR where the source master branch on
https://bitbucket.org/workingcopy/game/
and the destination is master branch on
https://bitbucket.org/palmin/game/
I POST the pull request content
{"title" = "My title",
"destination": {"branch": "master"},
"source": {"branch": "master",
"repository": {"repo_slug": "game",
"username": "workingcopy"}}
}
to the endpoint
https://api.bitbucket.org/2.0/repositories/palmin/game/pullrequests
but this gives me the errror message
"Source and destination must be different"
I tried including the "repository" dictionary inside "destination" but the error is the same.
I'm also having trouble creating cross-repository pull requests when branch names are different.
Trying to create a pull request where the source master branch on
https://bitbucket.org/workingcopy/game/
and the destination is release branch on
https://bitbucket.org/palmin/game/
I get the error message
"You do not have access to repository palmin/game and therefore you can not create a pull request."
The web-interface allows me to open a pull request like this when logged in as "workingcopy".
Any suggestions on things to do differently?
Hi Anders,
I've talked to some of my colleagues from the Bitbucket Cloud team and they provided the following solution. Can you edit this command according to your needs?
curl -X POST -H "Content-Type: application/json" -u username:apppass https://bitbucket.org/api/2.0/repositories/testingteamlog/repositorya/pullrequests -d '{ "title": "anotherBranch to master", "description": "AUTO: anotherBranch to master", "source": { "branch": { "name": "anotherBranch" }, "repository": { "full_name": "testingteamlog/repositorya" } }, "destination": { "branch": { "name": "master" } }, "close_source_branch": false }'
his syntax was wrong
he used this for source:
"source": {"branch": "master",
"repository": {"repo_slug": "game",
"username": "workingcopy"}}
while this is the source:
source": { "branch": { "name": "anotherBranch" }, "repository": { "full_name": "testingteamlog/repositorya" } }
Hope that helps!
Ana
Thank you. This is just what I needed. 🙏
Not sure why I couldn't figure this out on my own, but I did try many things.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.