You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
Git can't create pull request. If you want to do this from a command line you might want to look into the Bitbucket REST api.
Here is a link to the Bitbucket REST call you need:
P.S. I figured out what the problem was so hopefully the next person finds this. The username needs to be the username, not the login email address. And the password has to be an App Password, not your login password.
So I tried this with no success. I am not sure what I am missing. Here is my scenario:
I have a branch `feature/sc-6745-abs-accounting-a-p-ledger` and I want to create a PR to merge it into `develop`.
So I kick off the following from the command line (powershell in Windows):
curl https://api.bitbucket.org/2.0/repositories/jwdev/adris-web/pullrequests `
-u MyUserName:MyPassword `
--request POST `
--header 'Content-Type: application/json' `
"title": "My Title",
It came back with 401 unauthorized.
For the username, I am using my username, e.g. email@example.com. For password, I used my regular login password. I also tried creating an app password and gave it right to read/write pull requests. Both passwords came back as 401 unauthorized. I then created yet another app password and gave it every permission imaginable. Still didn't work.
I think I got the URL right. The workspace is called JW Development, but in the URL it's jwdev (e.g. https://bitbucket.org/jwdev/workspace/overview/). And the repository is called adris-web.
Why isn't it working?
Let me validate with my own repo, I will get back to this!
Hi @Robert Gelb
Sorry for the wait, busy times here :-). I got it working in Postman with this body:
"title": "My Title",
So exactly what you had. The URL was also correct!
What I did differently?
Under the repository I added an Access Token with the correct permissions :
Then I user this access token in my request. In the request this is translated into an authorization header:
Authorization: Bearer <your token>
Give it a try!