Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Create a pull request does not set Author as a PR owner

mohan yadav
Contributor
May 21, 2024

Hi 
I am using oauth2 with client key and secret and want to create PR with author (some other user)
https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-post

This end point creates PR and set PR owner/author based on my authenticated account username but I want PR owner/Author that I set in "author" parameter.

Capture.PNG

1 answer

0 votes
Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 23, 2024

Hey @mohan yadav ,

thank you for reaching out!

As stated in the Create a pull request endpoint documentation you have linked, the author of the pull request created by using that endpoint will be the authenticated user or the request : 

Creates a new pull request where the destination repository is this repository and the author is the authenticated user.

So, it will select the author solely based on the authentication credentials and not on the content of the payload of the request.

Could you share with us more details about your use case to create a pull request on another user's behalf? 

Thank you, @mohan yadav !

Patrik S

mohan yadav
Contributor
May 23, 2024

@Patrik S we built a system where user adds their selected remote git/bitbucket files from a feature branches into build( user can add multiples feature branch items/files into a single build) and our system check for PR conflicts, approver and merge the PR) an and finally all PR checks our system deploy added file into target DB.

So we want PR owner who added specific file so that they can receive email about PR comment, approval, denied etc action  . 

So as per API parameter it should save Author details as a owner of PR.

Patrik S
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
May 28, 2024

Hello @mohan yadav ,

thank you very much for sharing your use case with us.

I went ahead and created a feature request with our development team for that API endpoint to consider the Author from the payload, instead of just the authenticated user:

I would suggest you to add your vote there, since this helps both developers and product managers to understand the interest. Also, make sure you add yourself as a watcher in case you want to receive first-hand updates from that ticket. Please note that all features are implemented with this policy in mind.

Thank you, @mohan yadav .

Patrik S

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events