Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Use one of the other isUserInGroup methods

Marc Jason Mutuc
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 8, 2018

I'm currently using the following script as a validator

import com.atlassian.jira.component.ComponentAccessor
def groupManager = ComponentAccessor.getGroupManager()
groupManager.isUserInGroup(issue.reporter?.name, 'Group1') || groupManager.isUserInGroup(issue.reporter?.name, 'Group2') || groupManager.isUserInGroup(issue.reporter?.name,'Group3')

And I'm getting that warning message. What should I change? Can't find the documentation for it.

2 answers

2 votes
Stefani Kaimakliotou February 12, 2019

Instead of groupManager.isUserInGroup(issue.reporter?.name,'Group3') try groupManager.isUserInGroup(reporter,'Group3') 

You may be asked to include def reporter = issue.getReporter() first.

0 votes
Sam Bartolome November 15, 2022

I think some parenthesis between the first definition and the end, so you delimit the expression 

 

import com.atlassian.jira.component.ComponentAccessor

def groupManager = ComponentAccessor.getGroupManager()

(groupManager.isUserInGroup(issue.reporter?.name, 'Group1') || groupManager.isUserInGroup(issue.reporter?.name, 'Group2') || groupManager.isUserInGroup(issue.reporter?.name,'Group3'))

Suggest an answer

Log in or Sign up to answer
TAGS
atlassian, team ’25 europe, early bird extension, conference discount, barcelona, hybrid event, AI teamwork, early bird pass, digital access, collaboration conference, atlassian events, register now, developer conference

1 week left to save on your Team '25 Europe pass

Still thinking about joining us for Team '25 Europe? Early bird has been extended for just one week! Now’s the time to lock in your lowest rate. Use code TEU25COMM-20 to save 20% at checkout. Hurry, this only lasts for 1 more week.

Learn more
AUG Leaders

Atlassian Community Events