Queue

Represents a holding area for items before they are processed.

Parent Type 

This type extends Metadata and inherits its fields.

File Suffix and Directory Location 

The file suffix for queue components is .queue and components are stored in the queues directory of the corresponding package directory. This component supports cases, leads, service contracts (if Entitlements are enabled), and custom objects.

Version 

Introduced in API version 24.0.

Special Access Rules 

As of Summer ’20 and later, only authenticated internal and external users can access this type.

Fields 

description 

  • Type: string
  • Required: No
  • Description: A description of this component. The description should explain the component’s purpose and behavior so that administrators and developers understand when to use it.

doesIncludeBosses 

  • Type: boolean
  • Required: No
  • Introduced: API version 67.0
  • Description: Required. Indicates whether records shared with users in this queue are also shared with users higher in the role hierarchy (true) or not (false). This field corresponds to the Grant Access Using Hierarchies checkbox on the queue’s detail page.

doesSendEmailToMembers 

  • Type: boolean
  • Required: No
  • Description: Indicates whether emails are sent to queue members (true) or not (false) when a new record is added to the queue.

email 

  • Type: string
  • Required: No
  • Description: The email address of the queue owner.

name 

  • Type: string
  • Required: Yes
  • Description: Required. The name of the queue. Corresponds to Label in the user interface.

queueMembers 

  • Type: QueueMembers
  • Required: No
  • Introduced: API version 42.0
  • Description: Represents queue members added to the queue. Members can be added directly or selected by roles and public groups they belong to.

queueRoutingConfig 

  • Type: string
  • Required: No
  • Introduced: API version 42.0
  • Description: Routing configuration name. Applies to orgs that use Omni-Channel with a routing configuration.

queueSobject 

  • Type: QueueSobject[]
  • Required: No
  • Description: Indicates the supported entity types.

PublicGroups Type 

Represents public groups in the org. Public groups are optionally used to add queue members.

Version 

Introduced in API version 42.0.

Fields 

publicGroup 

  • Type: string[]
  • Required: No
  • Description: Represents a public group.

QueueMembers Type 

Represents queue members added to the queue. Members can be added directly as users or selected by the roles and public groups they belong to.

Version 

Introduced in API version 42.0.

Fields 

publicGroups 

  • Type: PublicGroups
  • Required: No
  • Description: Represents public groups in the org. Public groups are optionally used to add queue members.

roleAndSubordinates 

  • Type: RoleAndSubordinates
  • Required: No
  • Description: Represents roles and their subordinates in the org’s role hierarchy, including customer and partner roles. Roles and their subordinate hierarchy are optionally used to add queue members.

roleAndSubordinatesInternal 

  • Type: RoleAndSubordinatesInternal
  • Required: No
  • Description: Represents internal roles and their subordinates in the org’s role hierarchy, excluding customer and partner roles. Roles and their subordinate hierarchy are optionally used to add queue members.

roles 

  • Type: Roles
  • Required: No
  • Description: Represents roles in the org. Roles are optionally used to add queue members.

users 

  • Type: Users
  • Required: No
  • Description: Represents users in the org. Users can be added directly as queue members.

QueueSobject Type 

QueueSobject represents an entity type that the queue supports.

Fields 

sobjectType 

  • Type: string

  • Required: Yes

  • Description: Valid values are:

    • Case
    • ContactRequest
    • Lead
    • ServiceContract
    • Task (Available in API version 48.0 and later.)
    • Custom objects (such as ObjA_c)

RoleAndSubordinates Type 

Represents roles and their subordinates in the org’s role hierarchy, including customer and partner roles. Roles and their subordinate hierarchy can be used to add queue members.

Version 

Introduced in API version 42.0.

Fields 

roleAndSubordinate 

  • Type: string[]
  • Required: No
  • Description: Represents a role and its subordinates, including customer and partner roles. Only available when digital experiences is enabled for your org and Experience Cloud site users are created with external account roles other than a shared person account role.

RoleAndSubordinatesInternal Type 

Represents internal roles and their subordinates in the org’s role hierarchy, excluding customer and partner roles. Roles and their subordinate hierarchy can be used to add queue members.

Version 

Introduced in API version 42.0.

Fields 

roleAndSubordinateInternal 

  • Type: string[]
  • Required: No
  • Description: Represents a role and its subordinates, excluding customer and partner roles.

Roles Type 

Represents roles in the org. Roles can be used to add queue members.

Version 

Introduced in API version 42.0.

Fields 

role 

  • Type: string[]
  • Required: No
  • Description: Represents a role.

Users Type 

Represents users in the org. Users can be added directly as queue members.

Version 

Introduced in API version 42.0.

Fields 

user 

  • Type: string[]
  • Required: No
  • Description: Represents a user. Specify the user’s username.

Declarative Metadata Sample Definition 

The following is the definition of a queue, which supports Case, Lead, and a custom object named ObjA.

1<?xml version="1.0" encoding="UTF-8"?>
2<Queue xmlns="http://soap.sforce.com/2006/04/metadata">
3    <doesIncludeBosses>false</doesIncludeBosses>
4    <doesSendEmailToMembers>true</doesSendEmailToMembers>
5    <email>member@company.com</email>
6    <fullName>Your Name</fullName>
7    <name>memberQueue</name>
8    <queueSobject>
9        <sobjectType>Case</sobjectType>
10    </queueSobject>
11    <queueSobject>
12        <sobjectType>Lead</sobjectType>
13    </queueSobject>
14    <queueSobject>
15        <sobjectType>ObjA__c</sobjectType>
16    </queueSobject>
17</Queue>

Here’s another definition of a queue containing queue members added directly or via public groups and roles. Queries retrieve values using the DeveloperName field, not the Name field, so that the returned names are unique. The query also appends letters to the end of duplicate names, so these groups and roles can be referred to independently.

1<?xml version="1.0" encoding="UTF-8"?>
2<Queue xmlns="http://soap.sforce.com/2006/04/metadata">
3    <doesIncludeBosses>false</doesIncludeBosses>
4    <doesSendEmailToMembers>false</doesSendEmailToMembers>
5    <name>queue1</name>
6    <queueMembers>
7        <publicGroups>
8            <publicGroup>All Internal Users</publicGroup>
9        <publicGroups>
10        <queueRoleAndSubordinates>
11            <queueRoleAndSubordinate>role1</queueRoleAndSubordinate>
12            <queueRoleAndSubordinate>role2</queueRoleAndSubordinate>
13            <queueRoleAndSubordinate>role3</queueRoleAndSubordinate>
14        </queueRoleAndSubordinates>
15        <roles>
16            <role>role1</role>
17        </roles>
18        <users>
19            <user>s@sm.com</user>
20            <user>std@sm.com</user>
21        </users>
22    </queueMembers>
23    <queueRoutingConfig>my_omni_routing_config</queueRoutingConfig>
24    <queueSobject>
25        <sobjectType>Case</sobjectType>
26    </queueSobject>
27    <queueSobject>
28        <sobjectType>Lead</sobjectType>
29    </queueSobject>
30</Queue>

Wildcard Support in the Manifest File 

This metadata type supports the wildcard character * (asterisk) in the package.xml manifest file. For information about using the manifest file, see Deploying and Retrieving Metadata with the Zip File.