As of this writing, Salesforce provides no way of reporting on who belongs to which queues. To know who is a queue member, you must either (a) go to the Salesforce Setup page to manage the queue or (b) run a SOQL query and join on groupmember object then export the data using Data Loader or Enabler for Excel. But wouldn’t it be great if there was an easier way? Perhaps a visualforce page to let you browse members and provide an export to Excel button? Read on for the solution and code.

(A) Queue Setup Page
queuesetuppage.PNG

(B) SOQL Example

    SELECT  
         id, name, username, isActive  
    FROM  
         user  
    WHERE  
         id IN ( SELECT userOrGroupId FROM groupmember WHERE groupId = :groupId )  
    ORDER BY  
         name  

The Solution: Visualforce and Apex

Inspired by Chris Kress‘ post asking how to write a SOQL query to get a list of users assigned to queues, I put together some basic visualforce pages to demonstrate how to use the query and to conveniently export user records to Excel. The source code and deployment options are available on my github repository: https://github.com/DouglasCAyers/sfdc-queue-members-excel. It contains a controller class for executing the SOQL to get queues and users, a test class with 100% code coverage for easy deployment into production orgs, a visualforce page for selecting a queue and viewing its members, and a visualforce page that renders the same queue members list in Excel.

The great thing is that this requires no special libraries or third-party code, it’s all standard Salesforce functionality! Just too bad actually reporting on queue members isn’t a standard report option…