FlexiRule Docs
Automatically Assign Documents
Tutorial on routing documents to users based on round-robin or specific field values.
Tutorial: Automatically Assign Documents#
In this tutorial, we will build a rule that automatically assigns a “High Priority” Support Ticket to a Senior Support Engineer.
Business Scenario#
Objective: Ensure that critical issues are immediately brought to the attention of the right personnel without manual intervention. Prerequisites: A “Support Ticket” DocType with a “Priority” field.
Step-by-Step Instructions#
1. Create the Rule#
- Go to Rule List and click New.
- Rule Name: “Auto-Assign Critical Tickets”.
- Document Type: “Support Ticket”.
- Trigger Event: “Before Save”.
- Click Save and Open Rule Builder.
2. Add Priority Check#
- Add a Condition node after the Entry Action.
- Config:
priorityisHighORCritical.
3. Add Assignment Action#
- From the True branch of the Condition, add an Update Record action.
- Mode: “Create ToDo”.
- Assigned To:
senior_engineer@yourcompany.com(or use a dynamic expression to pick from a list). - Description:
High priority ticket {{ doc.name }} requires your attention.
4. Update Ticket Status#
- Add an Assignment node after the “Create ToDo” action.
- Target:
doc.status. - Operator:
Set. - Value:
Assigned.
5. Test and Enable#
- Run a Test Run with a High priority ticket.
- Verify that a ToDo is created and the ticket status changes to “Assigned”.
- Enable the rule.
Tips and Best Practices#
- Round-Robin: For more advanced routing, you can use a Process Operation that keeps track of the last assigned user in a custom DocType and picks the next one in line.
- Notification: Consider adding a Notify action (Toast) to tell the person saving the ticket that it has been automatically assigned.
Was this page helpful?