Community Announcements have moved! To stay up to date, please join the new Community Announcements group today. Learn more
×1 Details list of all Jira Users and Group
2 Script should print out Jira Users and what Group users are assigned
3 Should be able to access the page via
<jira_base_url>/rest/scriptrunner/latest/custom/doSomething
similar to documenation in https://scriptrunner.adaptavist.com/latest/jira/rest-endpoints.html?utm_source=product-help
Groovy Script prints username and group membership
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.bc.group.search.GroupPickerSearchService
import com.atlassian.crowd.embedded.api.Group
def groupSearch = ComponentAccessor.getComponent(GroupPickerSearchService)
def groupList = groupSearch.findGroups("")
def groupManager = ComponentAccessor.getGroupManager()
for (Group group in groupList){
log.error group.getName().toString()//print group names to log
log.error groupManager.getUsersInGroup(group)//print group members to log
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.