How to check if reporter is part of a group

Christian Körner November 25, 2016

In our issue configuration we have a group picker that should be set to one of the groups the reporter is part of.

We now need a validation that checks if the group selected in the group picker is really one of the groups of the reporter. This should be done in the create step of the issue.

Do you have any pointers how to accomplish this?

Thanks in advance!

1 answer

0 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.
November 26, 2016

Try this code for simple script validator provided by ScriptRuner plugin:

import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.fields.CustomField

CustomField groupPicker = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName("group picker")
return ComponentAccessor.getGroupManager().isUserInGroup(issue.getCreatorId(), issue?.getCustomFieldValue(groupPicker))

Suggest an answer

Log in or Sign up to answer