Assign documents automatically with an Assignment Rule ​

An Assignment Rule assigns documents to users when a condition is met. For example, ERPNext can share out new support Issues among the support team. Each assignment creates a ToDo for the user.

Create an Assignment Rule ​

  1. Open the Assignment Rule list, and select New.
  2. In Document Type, select the document, for example Issue.
  3. In Description, enter the text of the ToDo. You can use document fields, for example {{ priority }} priority issue {{ subject }} is assigned to you.
  4. Enter the conditions, as described below.
  5. In Rule, select how ERPNext picks the user, as described below.
  6. Add the users, or select the field.
  7. Select Save.

Conditions ​

Write each condition as a Python expression. You can use any field of the document, the operators ==, >, <, and the words and and or.

ConditionWhen ERPNext uses itExample
Assign ConditionAssigns the document when the condition is true.status == "Open"
Unassign ConditionRemoves the assignment when the condition is true.status == "On Hold"
Close ConditionCloses the assignment when the condition is true.status == "Closed"

A longer example: issue_type == "Technical" and priority == "High" and status == "Open".

Rules ​

RuleHow ERPNext picks the user
Round RobinEach user in the Users list in turn.
Load BalancingThe user in the Users list with the fewest open assignments.
Based on FieldThe user in a field of the document. Select the field in Field.
Weighted DistributionUsers in proportion to the Weight that you give each user. A user with weight 2 gets twice as many documents as a user with weight 1.

Use more than one rule ​

You can create many rules for one document type. Give each rule a Priority. ERPNext tries the rule with the highest priority first.

Set a due date on the assignment ​

In Due Date Based On, select a date field of the document, for example the Resolution By date of an Issue. ERPNext uses it as the due date of the ToDo, and updates the due date when the field changes.

The option appears only after you select the Document Type, and only if the document has a date or date-and-time field.

Assign only on some days ​

In the Assignment Days table, add the days on which the rule assigns documents, for example Monday to Friday. Leave the table empty to assign on every day.