EscalationRules

Represents case escalation rules to escalate cases automatically if they aren’t resolved within a certain time. You can access rules metadata for all applicable objects, for a specific object, or for a specific rule on a specific object.

The package.xml syntax for accessing all escalation rules for all objects is:

1<types>
2 <members>*</members>
3 <name>EscalationRules</name>
4 </types>

All rules for a specific object use a similar syntax without the wildcard. For example, all escalation rules for the Case object would use this syntax:

1<types>
2 <members>Case</members>
3 <name>EscalationRules</name>
4 </types>

You can also access specific escalation rules for an object. The following example only accesses the “samplerule” and “newrule” escalation rules on the Case object. Notice that for this example the type name syntax is EscalationRule and not EscalationRules.

1<types>
2 <members>Case.samplerule</members>
3 <members>Case.newrule</members>
4 <name>EscalationRule</name>
5 </types>

Parent Type 

This type extends Metadata and inherits its fields.

File Suffix and Directory Location 

EscalationRules for an object have the suffix .escalationRules and are stored in the escalationRules folder. For example, all Case escalation rules are stored in the Case.escalationRules file.

Version 

Introduced in API version 27.0.

Fields 

escalationRule 

  • Type: EscalationRule[]
  • Required: No
  • Description: Represents one escalation rule and specifies whether it’s active or not. Escalation rules are processed in the order they appear in the EscalationRules container.

EscalationAction Type 

Describes the action to take for an escalation rule.

Fields 

assignedTo 

  • Type: string
  • Required: No
  • Description: The name of the user or queue the item is assigned to.

assignedToTemplate 

  • Type: string

  • Required: No

  • Description: Specifies the template to use for the email that is automatically sent to the new owner specified by the escalation rule.

    Lightning email templates aren’t packageable. We recommend using a Classic email template.

assignedToType 

  • Type: AssignToLookupValueType (enumeration of type string)
  • Required: No
  • Description: Valid values are: User Queue
  • Possible values:
    • User
    • Queue

minutesToEscalation 

  • Type: int
  • Required: No
  • Description: The number of minutes until the escalation occurs.

notifyCaseOwner 

  • Type: boolean
  • Required: No
  • Description: Indicates that the owner of the case is notified when the case is escalated true) or not (false).

notifyEmail 

  • Type: string[]
  • Required: No
  • Description: Specifies the email address of the user to notify.

notifyTo 

  • Type: string
  • Required: No
  • Description: Specifies the user to notify.

notifyToTemplate 

  • Type: string
  • Required: No
  • Description: Specifies the template to user for the notification email.

EscalationRule Type 

Parent Type 

This type extends Metadata and inherits its fields.

Fields 

active 

  • Type: boolean
  • Required: No
  • Description: Indicates whether the escalation rule is active (true) or not (false).

fullName 

  • Type: string

  • Required: No

  • Description: Inherited from Metadata, this field is defined in the WSDL for this metadata type. It must be specified when creating, updating, or deleting. See createMetadata() to see an example of this field specified for a call.

    This value can’t be null.

ruleEntry 

  • Type: RuleEntry[]
  • Required: No
  • Description: Contains the definitions of the rule entries in the escalation rule.

RuleEntry Type 

Represents the fields used by the rule.

Fields 

assignedTo 

  • Type: string
  • Required: No

assignedToType 

  • Type: AssignToLookupValueType (enumeration of type string)
  • Required: No

booleanFilter 

  • Type: string
  • Required: No
  • Description: Advanced filter conditions that were specified for the rule.

businessHours 

  • Type: string
  • Required: No
  • Description: The hours when escalation actions are performed. Specify only if businessHoursSource is set to Static.

businessHoursSource 

  • Type: BusinessHoursSourceType (enumeration of type string)
  • Required: No
  • Description: Valid values are: None Case Static
  • Possible values:
    • None
    • Case
    • Static

criteriaItems 

  • Type: FilterItem[]
  • Required: No
  • Description: The items in the list that define the assignment criteria.

disableEscalationWhenModified 

  • Type: boolean
  • Required: No
  • Description: Indicates whether the escalation is disabled when the record is modified true) or not (false).

escalationAction 

  • Type: EscalationAction[]
  • Required: No
  • Description: The actions to perform when the escalation criteria are met.

escalationStartTime 

  • Type: EscalationStartTimeType (enumeration of type string)
  • Required: No
  • Description: Indicates the start time for the escalation.
  • Possible values:
    • CaseCreation
    • CaseLastModified

formula 

  • Type: string

  • Required: No

  • Description: The validation formula.

    Specify either formula or criteriaItems, but not both fields.

notifyCcRecipients 

  • Type: boolean
  • Required: No

overrideExistingTeams 

  • Type: boolean
  • Required: No

replyToEmail 

  • Type: string
  • Required: No

senderEmail 

  • Type: string
  • Required: No

senderName 

  • Type: string
  • Required: No

team 

  • Type: string[]
  • Required: No

template 

  • Type: string
  • Required: No

Declarative Metadata Sample Definition 

The following is an example EscalationRules component:

1<EscalationRules xmlns="http://soap.sforce.com/2006/04/metadata">
2    <escalationRule>
3        <fullName>samplerule</fullName>
4        <active>false</active>
5        <ruleEntry>
6            <businessHours>test</businessHours>
7            <businessHoursSource>Static</businessHoursSource>
8            <criteriaItems>
9                <field>Case.Description</field>
10                <operation>contains</operation>
11                <value>test</value>
12            </criteriaItems>
13            <escalationAction>
14                <assignedTo>someuser@org.com</assignedTo>
15                <assignedToTemplate>emailtemplatename</assignedToTemplate>
16                <assignedToType>User</assignedToType>
17                <minutesToEscalation>1440</minutesToEscalation>
18                <notifyCaseOwner>false</notifyCaseOwner>
19            </escalationAction>
20            <escalationStartTime>CaseLastModified</escalationStartTime>
21        </ruleEntry>
22    </escalationRule>
23</EscalationRules>

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.