From 89da327d15439c4f0c460bfbc10669d40b37db70 Mon Sep 17 00:00:00 2001 From: Gianfranco Paoloni Date: Fri, 14 Jan 2022 11:28:48 -0300 Subject: [PATCH] Added keepAvailable when assigning offline contact --- functions/assignOfflineContact.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/functions/assignOfflineContact.ts b/functions/assignOfflineContact.ts index abb8b928..4e95b450 100644 --- a/functions/assignOfflineContact.ts +++ b/functions/assignOfflineContact.ts @@ -107,7 +107,7 @@ const assignToOfflineWorker = async ( await targetWorker.update({ activitySid: availableActivity[0].sid, - attributes: JSON.stringify({ ...previousAttributes, waitingOfflineContact: true }), // waitingOfflineContact is used to avoid other tasks to be assigned during this window of time (workflow rules) + attributes: JSON.stringify({ ...previousAttributes, waitingOfflineContact: true, keepAvailable: true }), // waitingOfflineContact is used to avoid other tasks to be assigned during this window of time (workflow rules), keepAvailable is used to prevent custom worker status handler to set offline the worker during this interval }); const result = await assignToAvailableWorker(event, newTask);