Hello,
I'm new to script runner. I would like to create a script that searches for all users without a group assigned, and assign the group jira-users.
I already found some lines of code to find all users without a group:
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.util.UserUtil
UserUtil userUtil = ComponentAccessor.getUserUtil()
result = ''
userUtil.getUsers().findAll{userUtil.getGroupsForUser(it.getName()).size() == 0}.each{ u ->
result += u.name + ""
}
resultbut was not successful in adding the jira-users group
Thanks in advance
Achim