Skip to main content
Automation

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.

Start the 14-day free trial, no card

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 rulesCase assignment rules
Setup pathSetup > Feature Settings > Marketing > Lead Assignment RulesSetup > Feature Settings > Service > Case Assignment Rules
Default owner when no entry matchesSet in Lead SettingsSet in Support Settings (Default Case Owner)
Typical criteriaRegion, lead source, company sizePriority, product, origin, account tier
Typical assigneeSales rep or queueSupport queue
Created fromWeb-to-Lead, import, manual entryEmail-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 createdHow the rule is triggered
Web-to-Lead, Web-to-Case, Email-to-CaseRuns with the active rule. For Email-to-Case, leave the routing address Owner blank.
Manual entry in the UITick Assign using active assignment rules on the page
ApexSet DMLOptions.assignmentRuleHeader.useDefaultRule = true, per Salesforce Help
Flow, for LeadsUse the Apply Lead Assignment Rules action
REST APISend 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.

What should I read next?

Getting Started

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

SOC 2
HIPAA
ISO 27001
Salesforce Partner