Creating Pull Request on Behalf of Team Members via API Edited

I've been attempting to create a pull request on behalf of our team members in an autonomous manner.

I'm able to create the pull request if I authenticate as the particular user with their username and password, but if I attempt to provide an alternative author username, per the swagger documentation, the field is ignored and only the administrator account is permitted.

Is there an authentication mechanism in place, short of having every team member complete the OAUTH procedure (Not practical), in which I am able to perform the desired API call and specify an author?

Sample call, which succeeds, but uses the username specified in the auth header. I have not yet attempted to setup authentication with OAUTH: 

curl -X POST -H "Content-Type: application/json" -u ...:... https://bitbucket.org/api/2.0/repositories/.../.../pullrequests -d '{
"title": "...",
"description": "...",
"source":
{
"branch":
{
"name": "..."
},
"repository":
{
"full_name": ".../..."
}
},
"destination":
{
"branch":
{
"name": "..."
}
},
"close_source_branch": false,
"author": {
"type": "user",
"username": "...",
"display_name": "...",
"account_id": "...:...-...-...-...-...",
"links":
{
"self":
{
"href": "https://bitbucket.org/!api/2.0/users/..."
},
"html":
{
"href": "https://bitbucket.org/.../"
},
"avatar":
{
"href": "https://bitbucket.org/account/.../avatar/"
}
},
"type": "user",
"uuid": "{...}"
}
}'

 

0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Nov 06, 2018 in Bitbucket

Upgrade Best Practices

Hello! My name is Mark Askew and I am a Premier Support Engineer for products Bitbucket Server/Data Center, Fisheye & Crucible. Today, I want to bring the discussion that Jennifer, Matt, and ...

655 views 5 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you