How do Case Assignment Rules automate the initial routing of incoming support requests?
Answer
Basics: Without routing, cases land on whoever created them or on a default owner. An assignment rule says: if Priority = High and Product = Billing, assign to the Billing Escalations queue. Only one assignment rule can be active per object at a time.
How it works:
- Setup > Case Assignment Rules > New; name it and mark Active.
- Add Rule Entries with an order number, criteria (fields or formula), the assignee (user or queue), and an email template.
- Salesforce evaluates entries top to bottom and stops at the first match.
- Rules run automatically for Web-to-Case and (via routing settings) email-created cases, and for manual creation when "Assign using active assignment rules" is chosen.
- If no entry matches, the default case owner applies.
Advanced / deep dive: In Apex, rules do not run unless you ask via DML options. Flows do not apply assignment rules by default; verify the option for the element you use, or call Apex. Use Omni-Channel after the rule: assignment rules put the case into a queue; Omni-Channel then pushes it to an agent. For more complex logic such as skills or capacity, route through Omni-Channel Flow instead. Keep entries few and ordered most-specific first; very large rule sets are hard to maintain, so consider custom metadata with Flow.
Code / config example:
Database.DMLOptions dmo = new Database.DMLOptions();
dmo.assignmentRuleHeader.useDefaultRule = true; // run the active case rule
List<Case> cases = <Case>{ (Subject = , Priority = ) };
Database.insert(cases, dmo);