[solved] How to list group members

Is there a way to list all members assigned to a group ? Let’s say we have a group called “Sales”, eventually we would like to know which users are in that group.

Run as ‘zammad’ user:

cd /opt/zammad
zammad run rails c

First of all - list your groups (this will list your last 10 groups - I suppose you don’t have more):

users = Group.last(10)

You’ll find something like:

[#<Group id: 1, signature_id: 1, email_address_id: nil, name: “Users”, assignment_timeout: nil, follow_up_possible: “yes”, follow_up_assignment: true, active: true, note: “Standard Group/Pool for Tickets.”, updated_by_id:
1, created_by_id: 1, created_at: “2019-03-06 10:19:29”, updated_at: “2019-03-12 10:37:14”>,

Notice the Group id and note it down.

Now search all users which corresponds to group id:

users = UserGroup.where(group_id: ‘1’)

This should do the trick.

1 Like

Thanks, however, I meant through the web UI, so users (that don’t have ssh access) can see the group members.

There’s no such way except if all group members do have full access (“FULL”) to the group.
Simply by the either choosing “owner” in a ticket or via drag and drop of tickets.

See attached screencast. But beside of that your use case would be good to know, but somethings telling me that by user you don’t mean agent, but customer.


Great ! thanks, that’s what I needed. Yes, I meant internal users. It is good for the admin to have a quick way of knowing the members (other agents) of a group.

1 Like

Please add [SOLVED] add the beginning of topic :slight_smile: Thank you.

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.