Determine author to exclude from PR review on AP

Hello,

 

I'm using bitbucket API to create a bot that is executed inside pipelines and does the following:

  • Executes tests
  • If tests passes it publish packages and updates the package versions
  • It commit the changes and creates a new release branch
  • It creates a pull request (PR) from the new release

Im having problems with the last step. I am able to create the pull request if I don't include any reviewers. However If I try to include everyone on our team, I get an error like this:

 

"statusCode": 400, 
"body": {

"type": "error",

"error": {

"fields": {

"reviewers": [

"xxx is the author and cannot be included as a reviewer."

]
}
,
"message": "Bad request" }
}

Where xxx is me in this case.

How can I determine who is the author that should be excluded ? If I check the commit history from the API the latest commit was made by the bot, so technically I'm not the author of the PR. It this because I'm the author of the parent commit ? 

This is being triggered from bitbucket pipelines.

Can this be related with the fact that I'm using my own account with an app password to make the request to the API ?

 

Thanks in advance

 

1 answer

At the end the problem was that the user making the API call to create the pull request was being included as reviewer. It has nothing to do with commit authoring. 

 

Regards

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Posted Jun 06, 2018 in Bitbucket

Do you use Bitbucket Cloud and Jira Cloud? If so, let us know!

Hi Community, I'm Julia and I'm on the Jira Software Cloud marketing team!  We're looking for companies or teams using Bitbucket Cloud and Jira Software Cloud. If your team fits the t...

155 views 6 3
Join discussion

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