Newer Version Available

This content describes an older version of this product. View Latest

Queue

Represents a holding area for items before they are processed.

Declarative Metadata 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

Queue components are available in API version 24.0 and later.

Special Access Rules

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

Fields

This metadata type represents the valid values that define a queue:

Field Name Field Type Description
doesSendEmailToMembers boolean Indicates whether emails are sent to queue members (true) or not (false) when a new record is added to the queue.
email string The email address of the queue owner.
name string Required. The name of the queue. Corresponds to Label in the user interface.
queueMembers QueueMembers[] Represents queue members added to the queue. Members can be added directly or selected by roles and public groups they belong to. Available in API version 42.0 and later.
queueRoutingConfig string Routing configuration name. Applies to orgs that use Omni-Channel with a routing configuration. Available in API version 42.0 and later.
queueSobject QueueSobject[] Indicates the supported entity types.

QueueMembers

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. Available in API version 42.0 and later.

Field Name Field Type Description
publicGroups PublicGroups[] Represents public groups in the org. Public groups are optionally used to add queue members.
roleAndSubordinates RoleAndSubordinates[] 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 RoleAndSubordinatesInternal[] 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 Roles[] Represents roles in the org. Roles are optionally used to add queue members.
users Users[] Represents users in the org. Users can be added directly as queue members.

PublicGroups

Represents public groups in the org. Public groups are optionally used to add queue members. Available in API version 42.0 and later.

Field Name Field Type Description
publicGroup string Represents a public group.

RoleAndSubordinates

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. Available in API version 42.0 and later.

Field Name Field Type Description
roleAndSubordinate string Represents a role and its subordinates, including customer and partner roles.

RoleAndSubordinatesInternal

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. Available in API version 42.0 and later.

Field Name Field Type Description
roleAndSubordinateInternal string Represents a role and its subordinates, excluding customer and partner roles.

Roles

Represents roles in the org. Roles can be used to add queue members. Available in API version 42.0 and later.

Field Name Field Type Description
role string Represents a role.

Users

Represents users in the org. Users can be added directly as queue members. Available in API version 42.0 and later.

Field Name Field Type Description
user string Represents a user.

QueueSobject

QueueSobject represents an entity type that the queue supports.

Field Name Field Type Description
sobjectType string Valid values are:
  • Case
  • ContactRequest
  • Lead
  • ServiceContract
  • Task (Available in API version 48.0 and later.)
  • Custom objects (such as ObjA_c)

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    <doesSendEmailToMembers>true</doesSendEmailToMembers>
4    <email>member@company.com</email>
5    <fullName>Your Name</fullName>
6    <name>memberQueue</name>
7    <queueSobject>
8        <sobjectType>Case</sobjectType>
9    </queueSobject>
10    <queueSobject>
11        <sobjectType>Lead</sobjectType>
12    </queueSobject>
13    <queueSobject>
14        <sobjectType>ObjA__c</sobjectType>
15    </queueSobject>
16</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    <doesSendEmailToMembers>false</doesSendEmailToMembers>
4    <name>queue1</name>
5    <members>
6        <publicGroups>
7            <publicGroup>All Internal Users</publicGroup>
8        <publicGroups>
9        <queueRoleAndSubordinates>
10            <queueRoleAndSubordinate>role1</queueRoleAndSubordinate>
11            <queueRoleAndSubordinate>role2</queueRoleAndSubordinate>
12            <queueRoleAndSubordinate>role3</queueRoleAndSubordinate>
13        </queueRoleAndSubordinates>
14        <roles>
15            <role>role1</role>
16        </roles>
17        <users>
18            <user>s@sm.com</user>
19            <user>std@sm.com</user>
20        </users>
21    </members>
22    <queueRoutingConfig>my_omni_routing_config</queueRoutingConfig>
23    <queueSobject>
24        <sobjectType>Case</sobjectType>
25    </queueSobject>
26    <queueSobject>
27        <sobjectType>Lead</sobjectType>
28    </queueSobject>
29</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.