ScriptRunner allows you to quickly write merge checks.
Merge checks are used to prevent pull requests from being merged, until your required conditions are met. Example of uses for merge checks:
require a minimum number of reviewers
require reviewers of different levels of seniority
require more reviewers when the pull request author is an intern
require a minimum level of test coverage for newly-added or changed code
enforce that reviewers are in different time zones, to encourage knowledge sharing between regions
Adding a Merge Check
Navigate to Admin → Script Merge Checks. Click a heading to add a handler. Choose Custom Merge Check to use your own scripts to decide whether to allow the merge or not.