Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

I am having trouble getting started with Scriptrunner.

ragkapoor March 19, 2019

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")
}

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events