Conditional Merge Check

Allows you to specify a condition, which when evaluated to 'true' will cause a merge of the pull request to be vetoed.

Here is an example condition which will block a pull request merge if one of the reviewers marks the pull request as needs more work. You can find this example if you click "expand examples" under the condition field.

import com.atlassian.bitbucket.pull.PullRequestParticipantStatus

def reviewers = mergeRequest.pullRequest.reviewers

reviewers.any { it.status == PullRequestParticipantStatus.NEEDS_WORK }

Also note, that when specifying a conditional merge check, a custom 'veto message' can also be specified, which will be displayed to the user, whos merge is being prevented.