Assignment rules in Salesforce
- March 21, 2022
Assignment rules in Salesforce are used to automatically assign lead or case status to an owner (user or queue). An assignment rule automates the owner assignment on the case or lead based on conditions set for each category.
For example, there could be a lead assignment rule for web-generated leads and a case assignment rule for holiday use.
Types of assignment rule
Salesforce has provided assignment rules for two standard objects only:
- Lead Assignment Rule: Specifies how leads are assigned to users or queues as they’re created manually, captured from the web or imported via the Data Import Wizard or Dataloader.
- Case Assignment Rule: Determines how cases are assigned to users or put into queues as they’re created manually, using web-to-case, email-to-case, on-demand email-to-case, self-service portal or customer portal.
Setting up assignment rules
- From Setup, enter Assignment Rules in the Quick Find box and then select either Lead Assignment Rules or Case Assignment Rules.
- Choose New and then give the rule a name. Specify whether you want this to be the active rule for leads or cases created manually and via the web and email. Click Save.
NOTE: There can be only one active assignment rule (one for lead and one for case) at any one time. So, if an active rule already exists and you create a new active rule for the same object, the new rule will be active and the previous rule will be deactivated.
- To create the rule entries, click New. For each entry, you can specify:
- Order: Sets the order in which the entry will be processed in the rule; for example, 1, 2 or 3.
Salesforce evaluates each entry in order and tries to match the criteria of the entry. As soon as a match is found, Salesforce processes the item and stops evaluating the rule entries for that item. If no match is found, the item is reassigned to either the default web-to-lead owner, the administrator doing a lead import or the default case owner
- Criteria: Specifies conditions that the lead or case must match for it to be assigned. Enter your rule criteria.
Choose criteria to be met and select the filter criteria that a record must be met to trigger the rule.
For example, set a case filter to Priority = High if you want case records with the priority field marked high to trigger the rule.
If your organization uses multiple languages, enter filter values in your organization’s default language. You can add up to 25 filter criteria, each of which is up to 255 characters. When you use picklists to specify filter criteria, the selected values are stored in the organization’s default language. If you edit or clone existing filter criteria, first set the Default Language on the Company Information page to the same language used to set the original filter criteria. Otherwise, the filter criteria may not be evaluated as expected.
Choose “formula evaluates to true” and enter a formula that returns a value of “True” or “False.” Salesforce triggers the rule if the formula returns “True.”
For example, the formula AND(ISCHANGED( Priority ), ISPICKVAL (Priority, “High”) ) triggers a rule that changes the owner of a case when the priority field is changed to high. If your condition uses a custom field, the rule entry will be deleted automatically if the custom field is deleted.
- User: Specifies the user or queue to which the lead or case will be assigned if it matches the condition. Users specified here cannot be marked “inactive” and they must have “Read” permission on leads or cases.
- Do not reassign owner: Specifies that the current owner on a lead or case will not be reassigned to the lead or case when it’s updated.
- Email template: Specifies the template to use for the email that’s automatically sent to the new owner. If no template is specified, no email will be sent. When assigning a lead or case to a queue, the notification goes to the queue email address specified for the queue and all queue members.
- Predefined case teams: Specifies the predefined case team(s) to add to a case when it matches the condition. A case team is a group of people who work together to solve cases.
- Replace any existing predefined case teams on the case: Specifies that any existing predefined case teams on the case are to be replaced with the predefined case teams on the condition, when a case matches the condition.
After creating the entry, click Save or Save & New to save the entry and create more entries.
Example:
Requirement: On Account we have a Picklist field called Region. The field has four values:
- AMER
- LATAM
- MEA
- APAC
We have the following queues in our organization:
- AMER Case Queue
- LATAM Case Queue
- EMEA Case Queue
- APAC Case Queue
We want an assignment rule that will assign cases created for Account that have Region Amer to AMER Case Queue; the same for other values:
Step 1. Go to Setup Search for “Case Assignment Rule”
Step 2. Click New Name for the rule “Case Assignment By Region”
Step 3. In the rule entries section, click New and fill in the following details:
- Sort Order = 1
- Run this rule if the = Criteria are met (Account: Region equal AMER)
- Queue = AMER Case Queue
Step 4: Click Save and then New to repeat the same steps for the rest of region
To test the assignment rule, create a case for an account where Region=Amer. If creating the case manually, make sure to check “Assign using active assignment rule.” This can be set as the default from Case Page Layout Properties. If you’re unable to see this checkbox even after enabling it from “Page Layout properties,” please make sure that assignment rule is active.
— By Rishabh Dubey