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

Automation to assign PR reviewer

Nishanth Korupolu May 29, 2023

Is there a way to assign a reviewer to a PR automatically when a PR is created?

3 answers

2 accepted

4 votes
Answer accepted
Caterina Curti
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 4, 2023

Hi,

I wrote an app that you can check out, install and customize (all of this for free) to assign reviewers when the PR is created.

 

Here is the full article covering the app: Assign PRs randomly to a specific list of users in Bitbucket Cloud 

 

And this is just to explain the logic of adding a reviewer to the PR: Add a reviewer to a PR using the REST API and Forge 

 



Would love to know if you use it or customize it for your own team requirements.

 

Cheers,
Caterina

2 votes
Answer accepted
Ulrich Kuhnhardt _IzymesCo_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
May 29, 2023

Hi @Nishanth Korupolu 

As @Sachin Dhamale has mentioned you can define PR default reviewers in repository settings. The reviewers will be added to every pull request. Groups cannot be configured, only individual users.

If you like to add groups as reviewers you can use an app like Workzone for Bitbucket cloud which gives you more flexibility and control how reviewers are added to PRs. You can define multiple rules based on the following parameters:

  • PR destination and source branch – you may have different reviewers/group for PRs to develop, or release or main
  • File/module paths – you may have different reviewers/groups for src/server/**, src/client/**, or **/test/**
  • Require N approvals per rule
  • Require successful builds, complete tasks etc

Workzone can also block merging the PR until all approvals for each applicable rule are given. You can even enable  auto-merge so Workzone merges the PR as soon as all rule conditions are met.

I hope this helps!

Best, Ulrich

// Izymes

Disclaimer: I represent Izymes. We make awesome tools for efficient development teams.

0 votes
Sachin Dhamale
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 29, 2023

@Nishanth Korupolu ,

 

Welcome to the Atlassian community !!

 

Can you provide more info on this is it ?

Nishanth Korupolu May 29, 2023

Sure,

I want to make an automation such that when a new PR is raised, the PR reviewer is assigned automatically from a group a pre-selected users.

I just want to assign the PR to the reviewer automatically. The PRs should be distributed evenly if possible amongst these pre-selected users.

Sachin Dhamale
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 29, 2023

What is PR here? 

Nishanth Korupolu May 29, 2023

PR is Pull Request

Sachin Dhamale
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 29, 2023

@Nishanth Korupolu 

 

You can use the Script Runner for Bitbucket Plugin there you can have option to add the auto reviewer to the pull request.

Refer this

Sachin Dhamale
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 29, 2023

@Nishanth Korupolu 

 

There is Default Reviewer option is also there

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events