diff --git a/functions/taskrouterListeners/transfersListener.private.ts b/functions/taskrouterListeners/transfersListener.private.ts index 48d3f8a3..484fc7a2 100644 --- a/functions/taskrouterListeners/transfersListener.private.ts +++ b/functions/taskrouterListeners/transfersListener.private.ts @@ -221,7 +221,7 @@ export const handleEvent = async (context: Context, event: EventFields) const client = context.getTwilioClient(); - await client.taskrouter.v1.workspaces + const originalTask = await client.taskrouter.v1.workspaces .get(context.TWILIO_WORKSPACE_SID) .tasks.get(originalTaskSid) .update({ @@ -240,13 +240,14 @@ export const handleEvent = async (context: Context, event: EventFields) await transitionAgentParticipants( context.getTwilioClient(), context.TWILIO_WORKSPACE_SID, - originalTaskSid, + originalTask, 'closed', taskAttributes.originalParticipantSid, ); } catch (err) { console.error( `Error closing original participant ${taskAttributes.originalParticipantSid} from interaction channel ${taskAttributes.conversationSid}`, + err, ); } }