Custom Script Validator on issue transition. Validate users

Hi,

On a transition screen. A user is currently forced to enter a comment and also assign the issue. 

image2017-3-22 11:20:3.png

I would like to add a validator where the assignee can only set the assignee to;

the current reporter or a member of a group (senior-content-editors).

Can I please get some assistance on how I can set this? I also don't know which option I have to choose from this menu;

image2017-3-22 11:18:45.png

Cheers,
Jason 

1 answer

2 votes
Vasiliy Zverev Community Champion Mar 22, 2017

Here is code for simple script validator

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue

if(ComponentAccessor.getGroupManager().isUserInGroup(issue?.getAssignee(), "senior-content-editors"))
    return false

if(issue.getReporterId().equals(issue?.getAssigneeId())){
    return false
}

return true

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Thursday in Jira

Meet the AUG leaders of Northern Virginia

@Rachel Wright (Jira Genie), @Billy Poggi (AUG NOVA, DC), and @Dana Jansen (Confluence Queen) are just some of the folks that lead one of the world's most active Atlassian User Group (AUG)....

131 views 5 9
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you