You could try something like this:-
import com.atlassian.sal.api.component.ComponentLocator
import com.atlassian.bitbucket.user.UserService
import com.atlassian.bitbucket.pull.PullRequestParticipant
def targetGroup = "NameOfYourReviewerGroup"
def userService = ComponentLocator.getComponent(UserService)
def approvedBySpecificGroup = mergeRequest.pullRequest.reviewers.findAll { it.approved }.any { participant ->
userService.isUserInGroup(participant.user, targetGroup)
}
approvedBySpecificGroup
The example above is similar to the code you provided, with a minor modification.
Let me know how it goes.
Thank you and Kind regards,
Ram
I think it should return !approvedBySpecificGroup because merge is blocked if condition is true.
Nevertheless this changed nothing.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.