Assignment Rules
Assignment rules are created using the Assignment Rule doctype and are specifically configured for HD Ticket.Basic Configuration
Unique name for the assignment rule (e.g., “Support Rotation”, “Priority Escalation”).Maximum length: 50 characters.
Description of what this rule does and when it applies.Maximum length: 140 characters.
Rule priority determines execution order. Higher priority rules are evaluated first.Available options:
- 0: Low
- 1: Low-Medium
- 2: Medium
- 3: Medium-High
- 4: High
When enabled, the rule is active and will be evaluated for new/updated tickets.Disabled rules are skipped during assignment processing.
Assignment Conditions
Define when tickets should be assigned using this rule.JSON array of conditions that must be met for assignment.Format:
[["field", "operator", "value"], ...]Example:Python expression for assignment conditions (legacy format).Example:
status == "Open" and priority in ["High", "Urgent"]Note: New rules should use assign_condition_json for better UI compatibility.Unassignment Conditions
Define when tickets should be unassigned.JSON array of conditions that trigger unassignment.Format:
[["field", "operator", "value"], ...]Example:Python expression for unassignment conditions (legacy format).Example:
status == "Closed"Assignment Schedule
Control when the rule is active during the week.Days of the week when this rule should be active.Each entry is an Assignment Rule Day with a
day field:- Monday
- Tuesday
- Wednesday
- Thursday
- Friday
- Saturday
- Sunday
Assignment Strategy
How tickets are distributed among eligible agents.Options:
- Round Robin: Distribute evenly in rotation
- Load Balancing: Assign to agent with fewest open tickets
- Based on Field: Assign based on a ticket field value
List of users who can receive assignments from this rule.Each entry contains:
user: Link to User doctype
Creating Assignment Rules
Via API
Via UI
The Assignment Rules interface provides a visual builder for conditions:- Navigate to Settings > Assignment Rules
- Click “New Assignment Rule”
- Enter name and description
- Set priority and schedule
- Build assignment conditions using the condition builder
- Add agents to the assignment pool
- Save and enable the rule
Base Support Rotation
Frappe Helpdesk automatically creates a base support rotation rule:The default assignment rule created during setup.Stored in HD Settings and initialized with:
- Document Type: HD Ticket
- Condition:
status == "Open" - All days enabled
- Disabled by default (enable after adding agents)
Condition Examples
Priority-Based Assignment
Status and Type
Time-Based (requires custom fields)
Team-Based
Rule Evaluation
Assignment rules are evaluated:- On ticket creation: When
assign_conditionis met - On ticket update: When conditions change
- Manual trigger: Via API or workflow actions
Updating Assignment Rules
Frontend Integration
The assignment rules UI is built with Vue 3 and uses reactive state management:Validation
Assignment rules are validated on save:- Name and description are required
- Name must be unique and ≤50 characters
- Description must be ≤140 characters
- Conditions must be valid JSON (when using
assign_condition_json) - At least one user must be in the assignment pool
- Users must exist and have Agent role
Best Practices
- Start Simple: Begin with basic status-based rules before adding complexity
- Use JSON Conditions: Prefer
assign_condition_jsonover text conditions for UI compatibility - Test Rules: Create rules as disabled, test thoroughly, then enable
- Priority Strategy: Use priorities to handle exceptions (e.g., high priority for urgent tickets)
- Schedule Awareness: Use assignment days for business hours coverage
- Monitor Load: Use load balancing for teams with varying ticket volumes
- Document Rules: Use clear descriptions explaining the rule’s purpose
- Regular Review: Audit rules quarterly to ensure they match current workflows
Troubleshooting
- Rule Not Triggering: Check that conditions match ticket fields exactly
- Wrong Agent: Verify user list and rule priority
- Schedule Issues: Confirm assignment_days are set correctly
- Condition Errors: Use JSON format validator before saving
- No Assignment: Ensure rule is enabled and users are active agents