Hi,
I need to lookup users in jira groups depending on value in a custom field "Site". I have tried to write the below function, which works if I write in the actual group name, shown below. What I need is an if statement (or similar) that sets a group name to the variable "group", which is then returned by the function.
Can this be achieved? Can similar behaviour be achieved with different technique?
Thanks
def lookupGroupMembers(String s){
/*
Parameter s = site
retVal = List of users
*/
def group = "None"
if ( s == "Site1" ){ group = "made-up-Jira-group"}
/* This works - using group name*/
def groupManager = ComponentAccessor.getGroupManager()
def retVal = groupManager.getUsersInGroup("made-up-jira-group")
/* This does not work - using group variable */
def groupManager = ComponentAccessor.getGroupManager()
def retVal = groupManager.getUsersInGroup("group")
return retVal
}