It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Creating Pull Request on Behalf of Team Members via API Edited

Drew Purkett Jul 12, 2018

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
This widget could not be displayed.
This widget could not be displayed.
Community showcase
Published in Bitbucket Pipelines

Building a Bitbucket Pipe as a casual coder

...ipe.sh :  #!/bin/bash source "$(dirname "$0")/common.sh" enable_debug extra_args="" if [[ "${DEBUG}" == "true" ]]; then extra_args="--verbose" fi # mandatory variables R...

3,061 views 1 20
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you