add reviewers to a pull request based on git blame
Asked by Michelle Geppert:

Is there a way automatically add reviewers to a pull request based on git blame?

There is a listener that can add reviewers, but no examples on how to run a git command so you know who to add. If there were, the git commands to find the answer is rather complicated. It would be nice if there were built in way to do this. It's an option on Gerrit.

addMandatoryUsers("user", "userB")  
addDefaultUsers("userC")  
addMandatoryGroups("mandatory")  
addDefaultGroups("default", "defaultB")


Answers:
author: Patrik S
body: Hello [@Michelle Geppert](/t5/user/viewprofilepage/user-id/4729369) ,

Thank you for reaching out to Atlassian Community.

If I understand your question correctly, you would like to explore ways on Bitbucket Cloud to manage the default reviewers/mandatory reviewers of your pull-request.

Default reviewers feature allow you to automatically add one or more users as reviewers when a pull request is created in your repository. Currently, the default reviewers can be configured at project or repository level, as following :

#### Project level - Default reviewers : {#toc-hId--481628816}

Adding default reviewers to a project allows you to specify reviewers that Bitbucket will automatically add to any pull requests in any repositories in your project, unless otherwise specified in the repository's settings.

1. In the project, select **project settings**in the left sidebar.

2. Select **Default reviewers** under **Pull Requests**on the left sidebar.

3. Select the **Add reviewers**button.

4. In the **Add default reviewers**dialog, add the names of any members of the workspace in which this project resides to add them as a default reviewer.

#### Repository level - Default reviewers : {#toc-hId-2005884017}

Adding a default reviewers at the repository level, only apply the changes to that specific repository.

1. In the repository, select **Repository settings**in the left sidebar.

2. Select **Default reviewers** under **Pull Requests**on the left sidebar.

3. Select the **Add reviewers**button.

4. In the **Add default reviewers**dialog, add the names of any members of the workspace in which this repository resides to add them as a default reviewer.

In addition to default reviewers, you can also configure merge checks in your repository to specify, for example, how many of the specified default reviewers should approve a pull request prior to merging to ensure that a minimum level of review occurs.Merge checks can be configure under Branch permissions, and you can refer to the following documentation on how to setup that :

* <https://support.atlassian.com/bitbucket-cloud/docs/suggest-or-require-checks-before-a-merge/>

Also, if your workspace is on a [Premium plan](https://www.atlassian.com/software/bitbucket/pricing), repository admins can prevent pull requests with unresolved merge checks from being merged.

Hope that helps. Do let us know in case you have any questions.

Thanks, [@Michelle Geppert](/t5/user/viewprofilepage/user-id/4729369) .

Kind regards,

Patrik S

comments: author: Michelle Geppert
body: So the answer is no that's not possible.

We have a large code base with a large team and we'd like to make sure the last person to touch the code being modified is on the pull request. But since that's not possible we'll make do.


Tags: bitbucket-cloud

cloud