Hallo,
I am new to this community and this is my first post.
I am trying to create a Pull request through Jenkins in bitbucket server repo, at first place with a reviewer named e.g. Max.
Can anyone help me with this?
Is it also possible to create Pull request in bitbucket server repo using command line?
Thank You for your time.
Hi @Pratik Shah ,
Welcome to the community..!
if you want to create pull request from command line I would suggest you to consider API
THIS page has complete details of PR APIs with examples
Hope it helps you
BR,
Leo
Thank you very much for reply Leo.
Can you please provide me concrete example of how to use this API?
For e.g. my repo is https://xyz.com/bitbucket/projects/abc/repos/abxdgf
How can I create pull requets from feature/dfg branch to develop branch using command line?
Thank You once again.
BR,
Pratik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Pratik Shah ,
I framed API call with given sample URL, you'll have modify URL, Project key and reponame in the call
curl -X POST -H "Content-Type: application/json" -u username:Password --basic https://xyz.com/bitbucket/rest/api/1.0/projects/abc/repos/abxdgf/pull-requests -d '{ "title": "PR Title Here", "description": "PR Description here", "fromRef": { "id": "feature/dfg", "repository": { "slug": "abxdgf", "name": null, "project": { "key": "abc" }}}, "toRef": {"id": "develop","repository":{"slug": "abxdgf", "name": null, "project": {"key": "abc"}}}}'
BR,
Leo
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Leo .. Thank You very much.. That actually works and has made my life much easier.
One more question: Is it possible to create pull request in same way, but by passing source branch name in a variable?
With best regard's,
Pratik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You can try it out but I didn't get a chance to play in that way
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Am getting illegal port number error while using these command..please guide
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.