function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Ranganath C NRanganath C N 

How to retrieve all queue_members of a queue using SOQL query

Ayush Gupta 14Ayush Gupta 14
Hi Ranganath,


[Select Id from Group where type='Queue' and Name='Queue Name']

Queues are stored as records in the table Group with 'Type' as "Queue".  Use this Id of the queue in the query

[Select UserOrGroupId From GroupMember where GroupId =:reqdGroupId]

to fetch all the users or groups which are members of the required queue.