The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

TAGS
AUG Leaders

Atlassian Community Events