Using Assignment Rules to Control Ticket Assignment in Frappe Framework V 14

Using Assignment Rules to Control Ticket Assignment in Frappe Framework V 14

Use Case:

Build a basic ticketing system using Frappe.

Description:

We Have two user groups: Agents and Supervisors.

The Ticket doctype has a Status field which is a drop down with the following options: Open, Pending, Resolved and Closed.

The status of the ticket will be used to control ticket assignment to users as follows:

When the status is Open, the ticket will be assigned to the Agents Group.

When the Agent resolves the ticket, the status is updated to Resolved.

When the status is equal to Resolved, the ticket will be assigned to the Supervisors Group in order to review the ticket before closing it (status == Closed).

In order to implement this logic, we created two assignment rules, one for each state change (Open and Resolved).

First Assignment Rule (Support):

Assign condition: status == “Open”

Close condition: status == “Resolved”

Second Assignment Rule (Review):

Assign condition: status == “Resolved”

Close condition: status == “Closed”

The Problem:

Case #1: Both Assignment Rules are enabled

When we set the status to Open, the first assignment rule is triggered and the ticket is assigned to an Agent (expected behavior).

We expect that when we change the status to Resolved, the Agent assignment should be removed and the ticket should be assigned to a user in the Supervisors group.

However, when we change the status from Open to Resolved, the Agent assignment is removed without creating a new assignment to the Supervisor.

Case #2: Only the Support assignment rule is enabled

When we set the status to Open, the first assignment rule is triggered and the ticket is assigned to an Agent.

When we set the status to Resolved the assignment is removed as expected.

However when we set the status to Pending, which should do nothing, the ticket is assigned to an Agent user.

Note: Please refer to the video for more information.