SchedulingRule

Represents a scheduling rule in Workforce Engagement Management. Scheduling rules determine when agents are assigned to shifts.

Parent Type 

This type extends Metadata and inherits its fields.

File Suffix and Directory Location 

SchedulingRule components have the suffix .schedulingRule and are stored in the SchedulingRules folder.

Version 

Introduced in API version 53.0.

Special Access Rules 

This type is available only if Workforce Engagement is enabled in your org. To view, create, edit, and delete records, the user requires the Workforce Engagement Planner permission set.

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.

isProtected 

  • Type: boolean
  • Required: No
  • Description: Indicates whether the component is protected (true) or not (false). The default value is false.

masterLabel 

  • Type: string
  • Required: Yes
  • Description: Required. The name of the rule.

schedulingCategory 

  • Type: SchedulingCategory (enumeration of type string)
  • Required: Yes
  • Description: Required. What the scheduling logic applies the rule to.
  • Possible values:
    • A — Service Appointment
    • B — Shift

schedulingRuleParameters 

  • Type: SchedulingRuleParameter[]
  • Required: No
  • Description: Parameters associated with a scheduling rule, such as work limits.

schedulingRuleType 

  • Type: SchedulingRuleType (enumeration of type string)
  • Required: Yes
  • Introduced: API version 56.0
  • Description: Required. Specifies the type of rule.
  • Possible values:
    • A — Active Resources
    • B — Match Skills
    • C — Availability
    • M — Match Territory
    • Q — Match Queue
    • RestTimeMinutes — Rest Time in Minutes. Available in API version 56.0 and later.
    • W — Work Limit
    • LimitNonstandardShifts — Specifies a rule type that limits how many non-standard shifts can be assigned to each agent. Available in API version 54.0 and later.

SchedulingRuleParameter Type 

Represents a scheduling rule parameter, such as a work limit, that’s associated with a scheduling rule.

Fields 

schedulingParameterKey 

  • Type: SchedulingParameterKey (enumeration of type string)
  • Required: Yes
  • Introduced: API version 56.0
  • Description: Required. The scheduling rule parameter key.
  • Possible values:
    • C — Constraint Field Name
    • L — Limit Type
    • R — Resolution
    • T — Time Resolution
    • W — Work Unit
    • ConsiderAbsence — Consider resource absences when evaluating availability. Available in API version 56.0 and later.
    • ConsiderSTM — Consider service territory membership, which defines working hours, when evaluating availability. Available in API version 56.0 and later.

value 

  • Type: string
  • Required: No
  • Description: The scheduling rule parameter value.

Declarative Metadata Sample Definition 

The following is an example of a SchedulingRule component.

1<?xml version="1.0" encoding="UTF-8"?>
2<SchedulingRule xmlns="http://soap.sforce.com/2006/04/metadata">
3    <masterLabel>Max Shifts Per Week</masterLabel>
4    <schedulingCategory>B</schedulingCategory>
5    <schedulingRuleParameters>
6        <schedulingParameterKey>C</schedulingParameterKey>
7        <value>MaxShiftsPerWeek</value>
8    </schedulingRuleParameters>
9    <schedulingRuleParameters>
10        <schedulingParameterKey>W</schedulingParameterKey>
11        <value>Shifts</value>
12    </schedulingRuleParameters>
13    <schedulingRuleParameters>
14        <schedulingParameterKey>R</schedulingParameterKey>
15        <value>Week</value>
16    </schedulingRuleParameters>
17    <schedulingRuleParameters>
18        <schedulingParameterKey>L</schedulingParameterKey>
19        <value>Max</value>
20    </schedulingRuleParameters>
21    <schedulingRuleType>W</schedulingRuleType>
22</SchedulingRule>

The following is an example package.xml that references the previous definition.

1<?xml version="1.0" encoding="UTF-8"?>
2<Package xmlns="http://soap.sforce.com/2006/04/metadata">
3    <types>
4        <name>SchedulingRule</name>
5	<members>MaxShiftsPerWeek</members>
6    </types>
7    <version>53.0</version>
8</Package>

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.