+ Start a Discussion
hiteshwar marnihiteshwar marni 

queue users

How to query all the users in a particualr queue

thanks
EldonEldon
Hi,

Queues are stored as records in the 'Group' table with 'Type' as 'Queue'. 

You can use the below SOQL to get your QUEUE,

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

Then using this id you can get the members(users) from the following SOQL,

[Select UserOrGroupId From GroupMember where GroupId =:GroupID ] ;

 
For more information, refer,
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_group.htm 
http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_groupmember.htm

Regards