You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
I need to implement a workflow where I need
1. Validate whether approver and submitter of pull request are not same
2. Check the status and project details of the JIRA issue
What I have till now is the below
import com.atlassian.bitbucket.scm.pull.MergeRequest
def MergeRequest mergeRequest
def pullRequestDetails = mergeRequest.getPullRequest()
def pullRequestParticipantDetails = mergeRequest.pullRequest.getParticipants()
def reviewer = mergeRequest.pullRequest.reviewers.any {it.approved}
def user = mergeRequest.pullRequest.reviewers.any {it.user.name}
if (user == reviewer) {
mergeRequest.veto("Reviewer and User cannot be the same", "Need some one other than the user to approve")
}