AssignmentRules is the object-level container for named assignment rules that automatically route records, including cases, to users or queues. It groups an object's routing definitions, including matching conditions, assignment destinations, and optional email and case-team behavior.
Do not confuse AssignmentRules with AssignmentRule. The plural type identifies the object's container; the singular type identifies an individual named rule inside it. Activation belongs to each individual rule, not to the container.
Key Elements
The container holds an assignmentRule collection. Each child rule has its own identity, activation setting, and ruleEntry collection.
| Element | What the Element Controls |
|---|---|
assignmentRule |
The named assignment rules contained for the object. Rules are processed in the order they appear in the container. |
fullName |
The individual rule's name within the container, such as samplerule. It cannot be null and is required when creating, updating, or deleting the named rule. |
active |
Whether the individual assignment rule is active: true or false. |
ruleEntry |
The collection of entries defining matching conditions, assignment destinations, and optional notification or case-team behavior. |
assignedTo |
The name of the destination user or queue, not its record ID. Interpret it together with assignedToType. |
assignedToType |
The destination type. Allowed values are User and Queue. |
criteriaItems |
Matching criteria expressed through fields, operations, and comparison values. Use this or formula, not both. |
booleanFilter |
The advanced filter expression used with criteriaItems. |
formula |
The formula used for matching. Field references can be embedded in the expression. Use this or criteriaItems, not both. |
overrideExistingTeams |
Whether assignment resets the case team (true) or adds the specified team without replacing the previous team (false). |
team |
The case-team name. Salesforce defines this as a repeatable string[], allowing zero or more values. |
template |
The EmailTemplate used for the email automatically sent to the designated recipient. |
notifyCcRecipients |
Whether addresses on the Cc line of an incoming Email-to-Case or Web-to-Lead message are included on the Cc line of its auto-response. |
Behavior and Constraints
Each assignmentRule has its own active flag and routing entries. Salesforce processes rules in the order they appear within the AssignmentRules container.
A ruleEntry must use either formula or criteriaItems, not both. With explicit criteria, booleanFilter expresses advanced filter conditions. A field change can affect routing through criteriaItems.field or through a reference embedded in formula; checking only explicit criteria misses formula dependencies.
assignedTo and assignedToType work together. The destination is a user or queue identified by name, not by record ID. A possible association with CustomObject does not introduce another destination type: assignedToType remains limited to User and Queue.
Case-team settings change more than record ownership. With overrideExistingTeams=true, assignment resets the team. With false, it adds the specified team without replacing the previous team. Some metadata tooling exposes team as a single string even though Salesforce defines it as a repeatable string[]. When multiple case teams matter, do not assume that one exposed value represents the complete serialized configuration.
The two email settings serve different purposes. template selects the automatic email sent to the designated recipient. notifyCcRecipients expands the auto-response's Cc recipients using addresses from the incoming Email-to-Case or Web-to-Lead message; it is not merely an assigned-owner notification switch.
Deployment and Retrieval
Assignment-rule files use the .assignmentRules suffix and reside in the assignmentRules directory. For example, the Case container is stored as assignmentRules/Case.assignmentRules.
The component name identifies the object whose rules the file contains. The entire file base follows <objectName>, preserving any namespace. For Case.assignmentRules, the component name is Case.
In package.xml, the manifest that selects metadata components, the type and member together determine retrieval scope:
-
AssignmentRuleswith member*selects all assignment rules for all applicable objects. -
AssignmentRuleswith memberCaseselects all assignment rules for Case. -
AssignmentRulewith memberCase.sampleruleselects only the named child rulesampleruleon Case. Additional named children can be listed separately, such asCase.newrule.
Within the container XML, the child's fullName is samplerule, not Case.samplerule. That non-null child identity is required when creating, updating, or deleting the rule. Keep the object-level container name, manifest child name, and nested child name distinct when selecting changes.
Lightning email templates are not packageable. Use a Classic email template for this assignment-rule email use.
Container deletion is not interchangeable with deleting individual rules. A reported rejection of the standard Case container is described under Reported Issues; it does not establish that individual AssignmentRule children cannot be deleted. Likewise, the name-based association with an object does not require the object and its rule container to be deployed or deleted together.
Relationships
AssignmentRules contains AssignmentRule children through assignmentRule. Within their entries, destinations, email templates, and field conditions create separate dependencies. These connections describe possible references, not proof that every container uses every related type.
The object's name-based association is separate from XML element references: the entire component file base identifies the CustomObject metadata context. This can be a standard or custom object; the association does not prove that an object is custom, that an associated component exists in a particular org, or that a particular deployment order is required.
References
-
Queue:assignedTo, whenassignedToTypeisQueue. -
EmailTemplate:template. -
CustomField:criteriaItems.fieldand field references embedded informula. -
CustomObject: a possible association throughassignedTo. This does not add an allowed value toassignedToTypeand is distinct from the file-name association.
Reported Issues
-
Deleting the Case container can fail as a standard-metadata deletion. An org-cleanup script last updated in 2022 reported the rejection
The AssignmentRules called 'Case' is standard and cannot be deleted. This concerns deletion of the container, not deletion of an individual named rule. See the org-cleanup report. -
An "Owner (Assignment)" history label does not identify which named assignment rule ran. In a January 2026 report, UI-triggered custom Omni routing assigned a case to a queue, followed by an "Owner (Assignment)" change to the default case owner. The reporter stated that no Case Assignment Rules or other known owner-changing automation existed, and that equivalent Flow or API routing behaved differently. The cause was not established; the report does not prove that
AssignmentRulesmetadata caused the reset. See the case-owner fallback discussion.
Common Questions
How do I retrieve all Case assignment rules or just one rule?
Use type AssignmentRules with member Case for the entire Case container. Use type AssignmentRule with a member such as Case.samplerule for one named child. Inside the container, that child's fullName is only samplerule.
Does assignedTo accept a Salesforce user or queue ID?
No. assignedTo identifies the user or queue by name. Set assignedToType to User or Queue to identify which kind of destination the name represents.
Can an assignment-rule entry contain both formula and criteriaItems?
No. Specify either formula or criteriaItems. When using criteria items, booleanFilter expresses advanced filter conditions.
Will assignment replace the existing case team?
That depends on overrideExistingTeams. A value of true resets the team; false adds the specified team without replacing the previous team. The team element can contain multiple values in Salesforce's serialized metadata.
Can I delete all Case assignment rules by deleting the AssignmentRules container?
Do not treat container deletion as equivalent to deleting named children. A community cleanup report records rejection of the Case container because it was standard metadata. That report does not establish that individual AssignmentRule children cannot be deleted.