apex get queues owned by user id code example Example: apex query queue select Id from Group where Type = 'Queue'