Custom Script Validator on issue transition. Validate users

jjgalea March 22, 2017

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
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
March 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