I was able to create a scripted field getting the groups of the reporter. Below is the script:
import com.atlassian.crowd.embedded.api.User
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.UserPropertyManager
def groupManager = ComponentAccessor.getGroupManager()
def GroupList = groupManager.getGroupsForUser(issue.reporter)
return GroupList
However, I only want to get specific groups with the name starting with "Team". Can I get some help on how to do this please?
Also, I'm getting this error messsage when I'm trying to create an issue and the field is not applied to a screen:
Exception occurred: com.atlassian.plugins.rest.common.json.JsonMarshallingException: org.codehaus.jackson.map.JsonMappingException: No serializer found for class com.atlassian.crowd.embedded.impl.ImmutableGroup and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationConfig.Feature.FAIL_ON_EMPTY_BEANS) ) (through reference chain: com.atlassian.jira.quickedit.rest.api.field.QuickEditFields["createdIssueDetails"]->com.atlassian.jira.rest.v2.issue.IssueBean["fields"]->java.util.HashMap["customfield_24609"]->com.google.common.collect.RegularImmutableSet[0])