Set Customfield based on Group Membership

Sven Winkelmann August 20, 2014

I've a single list of our Departments as Customfield. When somebody creates a new ticket this customfield shoud be filled out automattily based on the group membership of the reporter. The name of the groups and the list are the same.

The groovy plugin should do this but i've no clue how.

1 answer

0 votes
Alexey_Rjeutski__Polontech_
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.
August 20, 2014

If you need scripted field from groovy runner - see https://jamieechlin.atlassian.net/wiki/display/GRV/Scripted+Fields

As for the usage itself -

import com.atlassian.jira.component.ComponentAccessor

def userId = issue.getReporterId();

def groups = ComponentAccessor.getGroupManager().getGroupNamesForUser(userId);

def result = "";

for (def group: groups)

  result += result.length() > 0? ", " + group: group;

return result;

Sven Winkelmann August 20, 2014

No a scripted field wouldn't work, it must be a group from that list

Suggest an answer

Log in or Sign up to answer