What is Assignment Rule in Salesforce?
Updated · By the Clientell AI team · How we write
An assignment rule is a Salesforce setting that automatically sets the owner of a new Lead or Case. The rule holds ordered entries, each with filter criteria and a user or queue. Salesforce checks a record against the entries in order, and the first match wins. Only one assignment rule per object can be active at a time.
Key facts
- Works on
- Leads and Cases, per the AssignmentRule object
- Active rules
- Only one can be active at a time, per Salesforce Help
- Assigns to
- A user or a queue
- Lead rules
- Setup > Feature Settings > Marketing > Lead Assignment Rules
- Case rules
- Setup > Feature Settings > Service > Case Assignment Rules
- No match
- The record goes to the default owner in Lead Settings or Support Settings, per Salesforce Help
Clientell AI, the AI Salesforce admin, builds and fixes Assignment Rule automation from a plain-English request. See the AI flow builder
Try it in Clientell AI
“Find every Assignment Rule in my org that touches the Opportunity object, list what each one does, and flag any that conflict.”
Clientell AI reads your org first. Platform deployments include rollback. How security works.
What is an assignment rule in Salesforce?
Assignment rules decide who owns a new Lead or Case. A rule has several entries. Each entry has an order number, filter criteria and an assignee. Salesforce walks down the list and gives the record to the user or queue of the first entry that matches.
Lead entries often use country, state, industry or lead source. Case entries often use priority, product, origin or account tier.
Lead assignment rules vs case assignment rules
A lead assignment rule is a rule for Lead records. A case assignment rule is the same idea for Case records. The Setup path, default owner and typical use differ.
| Lead assignment rules | Case assignment rules | |
|---|---|---|
| Setup path | Setup > Feature Settings > Marketing > Lead Assignment Rules | Setup > Feature Settings > Service > Case Assignment Rules |
| Default owner when no entry matches | Set in Lead Settings | Set in Support Settings (Default Case Owner) |
| Typical criteria | Region, lead source, company size | Priority, product, origin, account tier |
| Typical assignee | Sales rep or queue | Support queue |
| Created from | Web-to-Lead, import, manual entry | Email-to-Case, Web-to-Case, manual entry |
Why can only one assignment rule be active?
You can save many rules for an object, but one runs at a time. The Active checkbox on the rule controls which one. That is why teams build one rule with many entries. Salesforce Help says just one can be active at a time.
A team can still keep a second rule for a special case, such as a holiday rule, and swap which one is active. Test any change in a sandbox first.
When do assignment rules run?
Rules do not run on every save. They run only when the save asks for them. The channel decides how.
| How the record is created | How the rule is triggered |
|---|---|
| Web-to-Lead, Web-to-Case, Email-to-Case | Runs with the active rule. For Email-to-Case, leave the routing address Owner blank. |
| Manual entry in the UI | Tick Assign using active assignment rules on the page |
| Apex | Set DMLOptions.assignmentRuleHeader.useDefaultRule = true, per Salesforce Help |
| Flow, for Leads | Use the Apply Lead Assignment Rules action |
| REST API | Send the assignment rule header, or the rule is skipped |
Example: build a case assignment rule
This builds a rule that sends high-priority cases to an escalation queue.
- Setup > Users > Queues: create a Support Escalations queue and add Case as a supported object.
- Setup > Feature Settings > Service > Case Assignment Rules: click New and name the rule.
- Tick Active so this rule runs. Any other active case rule turns off.
- Add a rule entry with order 1: Priority equals High. Assign to the Support Escalations queue.
- Add a last entry with no criteria that assigns to your general Support queue.
- Create a Case with Priority High and Assign using active assignment rules ticked. Case.OwnerId then shows the escalation queue. If it shows you instead, the rule is not Active. To undo, untick Active on the rule.
Common mistakes with assignment rules
Most failures are one of these.
- The right rule is not Active. Open the rule list and check.
- The save did not ask for the rule. Records made by Apex, the API or Data Loader skip it unless you ask. Set the DML (data manipulation language) option or header.
- An earlier entry matches first. Reorder the entries.
- No catch-all entry. Records go to the default owner and look misrouted. Add a final entry.
- Another automation changes the owner after the rule ran. Check flows on Lead and Case.
FAQ: Assignment Rule in Salesforce
What is an assignment rule in Salesforce?
It is a set of ordered criteria that automatically assigns a Lead or Case to a user or queue.
How many assignment rules can be active?
One per object. Salesforce Help says just one can be active at a time.
What is the difference between lead and case assignment rules?
Lead rules route sales leads and live under Marketing in Setup. Case rules route support cases and live under Service. Each has its own default owner setting.
Where are case assignment rules in Salesforce?
In Lightning Experience, go to Setup > Feature Settings > Service > Case Assignment Rules.
How do I run case assignment rules from Apex?
Set assignmentRuleHeader.useDefaultRule to true on a Database.DMLOptions object. Call setOptions on the record before insert, as Salesforce Help shows.
What happens if no assignment rule entry matches?
The record goes to the default owner set in Lead Settings or Support Settings.
Sources: Salesforce Help: Assignment Rules fail to set the Owner, Salesforce Help: Lead or Case ownership changed automatically, Salesforce Help: Trigger Case Assignment Rules from Apex, Salesforce Developers: AssignmentRule object, Salesforce Developers: Lead Actions. Last reviewed .
Related Salesforce Terms
5 termsEmail-to-Case
DataEmail-to-Case automatically converts incoming customer emails into Case records in Salesforce, enabling support teams to manage email inquiries within the CRM.
Service Cloud
PlatformService Cloud is Salesforce's customer service platform that provides tools for case management, omnichannel support, knowledge bases, and field service operations.
Omni-Channel
PlatformOmni-Channel is Salesforce's intelligent routing engine that automatically pushes work items (Cases, Leads, Orders, or custom objects) to the most qualified available agent in real time.
Web-to-Lead
DataWeb-to-Lead is a Salesforce feature that automatically captures form submissions from your website and creates Lead records in your org.
Escalation Rule
AutomationEscalation Rules automatically escalate Case records that have not been resolved within a specified time frame, reassigning them or triggering notifications.
What should I read next?
More in Automation
View all →Flow
Flow is Salesforce's declarative automation tool that lets admins build complex business processes using a visual, drag-and-drop interface without writing code.
Process Builder (Deprecated)
Process Builder was a visual automation tool for creating processes triggered by record changes; it has been deprecated in favor of Flow.
Workflow Rule (Deprecated)
Workflow Rules were simple if/then automation triggers in Salesforce that have been deprecated and replaced by Flow.
Approval Process
An Approval Process is a Salesforce automation that routes records through a series of approval steps with designated approvers, actions, and rejection handling.
Try this on your own org
Start the 14-day free trial, no card. Clientell AI asks before it changes anything in production.
14-day free trial · No credit card required