Unassign conversations from deactivated users
Last Update: Nov 2024 • Est. Read Time: 3 MINDeactivated users in your organization may have conversations that remain assigned to them even after their account has been deleted.
If you want to unassign conversations from deactivated users so they get rerouted to your active agents, you can set up a Kustomer workflow to automate this process.
Who can access this feature? | |
User types | Admins can access the Workflows page. |
In this article
Prerequisites
Before following this guide, we recommend that you already be comfortable with the basics of using Workflows: Workflows Overview.
Create the workflow
Go to your Kustomer app and create a new workflow.
- Go to Settings
and select Platform > Workflows.
- Select Add Workflow. The New Workflow window opens.
- Enter a Workflow Title. You can leave the Description box blank because the code snippet below will provide this for you.
- Select Create to save the workflow and begin working in the Workflow Editor.
Enter the workflow JSON code
Use the Workflow Editor to paste in the workflow code supplied below. This JSON code will take care of most of the workflow creation.
- In the Workflow Editor, go to Workflow Options
and select Edit Workflow JSON.
A window appears where you can edit the code for this workflow directly.
- Select and delete the current JSON code.
- Copy the code block below, and paste it into the JSON text field in the Edit Workflow JSON window:
{ "description": "If a conversation is assigned to a deactivated agent and an inbound message comes in, will unassign and requeue the conversation.", "name": "unassign-if-agent-deactivated", "steps": [ { "transitions": [ { "meta": { "name": "Conversation is Assigned" }, "condition": { "values": [ "/#steps.NU2EZUSog.assignedUsers" ], "op": "exists" }, "target": "IQltI31uB" } ], "errorCases": [], "id": "NU2EZUSog", "action": "kustomer.conversation.find-by-id", "params": { "id": "/#steps.1.conversation" }, "appVersion": "kustomer-^1.9.2", "meta": { "displayName": "Find Conversation" } }, { "transitions": [ { "meta": { "name": "Assigned User is Deactivated" }, "condition": { "values": [ "/#steps.IQltI31uB.deletedAt" ], "op": "exists" }, "target": "seww9Jqjy" } ], "errorCases": [], "appVersion": "kustomer-^1.9.2", "action": "kustomer.user.find-by-id", "params": { "id": "/#steps.NU2EZUSog.assignedUsers.0" }, "id": "IQltI31uB", "meta": { "displayName": "Find User by ID" } }, { "transitions": [], "errorCases": [], "appVersion": "kustomer-^1.9.2", "action": "kustomer.conversation.update", "meta": { "displayName": "Unassign & Requeue Conversation" }, "params": { "assignedUsers": [], "id": "/#steps.NU2EZUSog.id" }, "id": "seww9Jqjy" } ], "trigger": { "transitions": [ { "target": "NU2EZUSog", "condition": { "op": "true", "values": [ true ] } } ], "eventName": "kustomer.message.create", "id": "1", "appVersion": "kustomer-^1.9.2" } }
- Select Update to dismiss the JSON editor and save the changes to the workflow.The workflow will look like the image below.
Customize the workflow
You can add changes to the workflow in the last Conversation Update step if you want the conversation to go to a different queue, team, or have a specific tag or attribute set. When you're finished making any changes to the workflow, select Save and turn on the toggle to activate the workflow.