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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,644,493
Community Members
 
Community Events
196
Community Groups

how to enable in bitbucket file pathsMatch, merge checks with specific person/team approvals

Edited

During merge request if specific file <PROD PROP> have changes,  it should allow merge after specific person/team approvals other wise it stop to merge.

 

Need help to make custom script for above request. 

2 answers

0 votes
Robert Giddings [Adaptavist]
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
Nov 26, 2021

Hi @maheswarreddyt ,

If you are using ScriptRunner for Bitbucket I would suggest you look a the following Built-In Scripts that should help you achieve what you want to do.

To start with you can block a merge using a Conditional Merge Check. Here is the documentation:

https://docs.adaptavist.com/sr4bib/latest/features/script-merge-checks/conditional-merge-check

As you can see in the example, the merge is blocked if any of the participants state the PR needs more work. You can amend this example for your needs. For example, blocking the merge when a particular reviewer has not yet approved the PR.

You can also use ScriptRunner for Bitbucket to add mandatory reviewers to Pull Requests. This can be done in a couple of ways.

1. As a simple list of users or groups you can use the Auto-Add Reviewers to a Pull Request Built-In Script: 

https://docs.adaptavist.com/sr4bib/latest/features/listeners/built-in-listeners/auto-add-reviewers-to-a-pull-request

2. Or, if you have more complex requirements, for example adding mandatory reviewers based on a particular file change etc, you can use the more advanced Dynamically Add Reviewers to a Pull Request Built-In Script:

https://docs.adaptavist.com/sr4bib/latest/features/listeners/built-in-listeners/dynamically-add-reviewers-to-a-pull-request

Please let me know how you get on using these ScriptRunner for Bitbucket Scripts?

Kind regards,

Robert Giddings,

Product Manager, ScriptRunner for Bitbucket

0 votes
Ulrich Kuhnhardt _IzymesCo_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
Sep 05, 2021

Hi Maheswar,

that's an interesting scenario, in fact it is quite common. While I can't supply a script that does exactly what you need, your requirement consists of 2 basic steps,

1. If a certain file path is part of a pull request changeset, add a mandatory reviewer.

2. Before the pull request can be merged, the mandatory reviewer must approve, otherwise the PR is blocked.

We have built out this functionality (no coding required) as part of the Workzone for Bitbucket   (Server/Datacenter) app.

If you are on a server or Datacenter instance, please let me know if need any help to set this up. Here is a start .

There are also other apps like Scriptrunner available that can potentially solve the problem.

Cheers Ulrich

Izymes

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events