I created a conditional merge check. Then I copy in either the "Named user approves" or "At least one user from experienced developers group has approved" code snippet and my pull request can still be merged in despite the condition not being met. I copy in the "Target branch is master" code and that blocks my code merge. What do I need to change to make these work?
mergeRequest.pullRequest.reviewers.find {it.approved && it.user.name == "seniordev"}
and
import com.atlassian.sal.api.component.ComponentLocator
import com.atlassian.bitbucket.user.UserService
def userService = ComponentLocator.getComponent(UserService)
mergeRequest.pullRequest.reviewers.findAll { it.approved }.any {
userService.isUserInGroup(it.user, "experienced-developers")
}