Defining Assignment Rules

From ServiceNow Wiki
Home > Administer > Managing Data > Task Table > Defining Assignment Rules
Jump to: navigation, search
Note: This article applies to Fuji. For more current information, see Define Assignment Rules at

The ServiceNow Wiki is no longer being updated. Please refer to for the latest product documentation.

1 Overview

ServiceNow can automatically assign a task to a user or group based on pre-defined conditions by using:

  • Data lookup rules
  • Assignment rules

1.1 Data Lookup Rules

Data lookup rules offer a generic way to change any field value, not just assignment fields. Data lookup rules offer the following improvements over the Assignment module:

  • Ability to change any field value not just an assignment field
  • More options to define when a rule runs:
    • On form change (Allows assignment rules to apply to unsaved changes on a form)
    • On record insert
    • On record update
  • Option to replace existing values (including default values)
Note: You can define data lookup and Assignment rules at the same time. The system ignores any duplicate rules after an incident has been assigned unless you are using a data lookup definition option to replace existing values.

1.2 Assignment Rules Module

The Assignment rules module allows you to automatically set a value in the assigned_to and assignment_group fields when a set of conditions occurs. An assignment rule must also meet these additional criteria to run:

  • The task record has been created or updated. Assignment rules do not apply to unsaved changes on a form.
  • The task record must be unassigned. The record cannot have an existing value for either the assigned_to or assignment_group fields. Assignment rules cannot overwrite existing assignments (including assignments set by a default value or a previously run assignment rule).
  • The assignment rule is the first rule that matches the table and conditions. If more than one assignment rule matches the conditions, only the rule with the lowest order value runs.

1.2.1 Precedence between Assignment Rules and Business Rules

When creating new assignment rules, keep in mind that business rules can take precedence over assignment rules in certain circumstances. Assignment rules and business rules run in the following order:

  1. All before business rules that run on a record insert with an order value less than 1000.
  2. The first assignment rule with the lowest execution order and matching condition.
  3. All before business rules that run on a record insert with an order value greater than or equal to 1000.
  4. All after business rules that run on record insert.

2 Defining Assignment Rules

You can define assignment rules either from Data Lookup and Record Matching Support, from the Assignment module, or from workflow Task Activities.

2.1 Data Lookup Rules

To define an assignment rule with Data Lookup and Record Matching Support:

  1. Navigate to System Policy > Rules > Assignment Lookup Rules.
  2. Click New.
  3. Populate the assignment data lookup fields (see table).
  4. Click Submit.
The Assignment Data Lookup form

Field Input Value
Category Select the category the data lookup matches against.
Subcategory Select the subcategory the data lookup matches against.
Configuration Item Select the configuration item the data lookup matches against.
Location Select the location the data lookup matches against.
Assignment Group Select the assignment group to assign the incident to.
Assigned To Select the user to assign the incident to.
Active Set to Yes to run the rule or No to deactivate the rule.
Order Enter the order in which the rule runs compared to other rules on the same table. The Data Lookup Plugin runs the rule with the lowest order and matching values.
Note: The assignment lookup rule assigns incidents matching the values in the matcher fields (Category, Subcategory, Configuration Item, and Location) to the values in the setter fields (Assignment Group and Assigned To). A valid assignment lookup rule requires at least one matcher field and one setter field.

2.2 Assignment Module Rules

To define an assignment rule:

  1. Navigate to System Policy > Rules > Assignment and click New.
  2. Complete the fields on the form (see table).
The Assignment Rule form for software requests

Note: You might need to configure the form to see all the fields below.
Field Description
Name The descriptive name for the assignment rule.
Active An indicator of whether the assignment rule is active. Only active assignment rules take effect.
Applies to
Table The table with the records that the assignment rule applies to.

Note: The list shows only tables and database views that are in the same scope as the assignment rule (starting with the Fuji release).
If you select a custom table that extends the task table, you must clear the instance cache by navigating to https://<instance_name> in order for the assignment rule to work.
Conditions The conditions in which the assignment rule will apply.
Assign to
User The user which will be assigned the event.
Group The group which will be assigned the event.
Script A script to determine advanced assignment rule functionality. The current.variable_pool set of variables is available.
Other fields
Match Conditions Choices are:
  • Any - Assignment Rule will apply if any of the conditions are met.
  • All - Assignment rule will apply if all of the conditions are met.
Order A number to determine priority over conflicting assignment rules. If there are conflicting assignment rules, rules with lower Order values will take precedence over rules with higher Order values. If the Order values are all set to the same number the assignment rule with the first matching condition is run with precedence over the others. Only one assignment rule will run against a record, the first with a matching condition.

2.3 Workflow Assignments

An alternative to creating data lookup or assignment rules is to create one or more workflow tasks that assign a task record as part of a workflow. Consider using a workflow for assignment if your process includes multiple steps or conditions such as requiring a particular group approve a request.

When using a workflow to manage task assignments, add a brief timer activity to the start of the workflow. Without this timer activity, the workflow runs before the parent record, the current record, is inserted into the database. After the timer activity completes, the workflow resumes using the parent record information from the database instead of the original current. Note that pausing a workflow in this way does not change a default workflow to a deferred workflow. For more information on how the workflow engine interacts with the database, see workflow engine operation order.

3 Examples

These examples illustrate creating assignment rules using the Data Lookup Plugin, the Condition Editor, and with a script.

3.1 Assignment Lookup Rules

In the following example, the Data Lookup Plugin assignment lookup rule automatically assigns any incident with the Category of Request and Subcategory of Password Reset to Fred Luddy.

Assignment data lookup example

3.2 Baseline Assignment Rules

A baseline instance contains the following assignment rules.

Name Table Conditions Assigned to User, Assigned to Group, or Script
Networking incident Category is Network User: System Administrator

Group: Network

Database or Software incident Category is one of Request, Inquiry / Help, Software, Hardware User: System Administrator

Group: Software

SC Item fulfillment - Field Services Ticket Parent.Task type is Request item Group: Field Services
Release Planning release_phase Name is Plan Script:
IT Hardware sc_req_item Approval is Approved and

Item.Category is Request Computers and Hardware

User: System Administrator

Group: Hardware

Service Desk incident Active is true Group: Service Desk

3.3 Condition Editor

In the following example, the assignment rule uses a condition statement to automatically assign any incident opened in the Network category to the System Administrator in the Network assignment group.

Assignment lookup rule with condition

3.4 Script

In the following example, the assignment rules use JavaScript code to assign incidents to a particular assignment group based on the incident category:

This Incident Category Is Assigned to this Assignment Group
Hardware Hardware
Software Software
Malware Security
Assignment rule with script

The following script requires personalizing the instance to add the Malware category and the Security assignment group.

if (current.category == "Hardware"){
}else if (current.category == "Software"){
}else if (current.category == "Malware"){
Was this article helpful?
Yes, I found what I needed
No, I need more assistance