Execute bot after chat transfer to another department
The goal is to:
- Have
Bot A
inDepartment A
. - Bot A has a trigger that sets the chat to a pending state.
Department A
is configured to transfer the chat toDepartment B
if the chat is not accepted within 30 seconds.Department B
hasBot B
.- After the transfer, the chat should revert to bot status, and
Bot B
's trigger should execute.
Requirements:
- Minimum version 4.16v.
- Cron job setup as described here.
- This setup allows the transfer between departments even if the visitor has left the chat.
- This is also required for third-party integrations.
How it works:
- Transfer between departments occurs only if the chat is in a pending state.
- After the transfer, listen to
chat.data_changed_assigned_department
and adjust chat attributes accordingly:- Change the chat's
bot_id
attribute. - Set the chat status to bot chat.
- Change the chat's
- It is also advisable to check the incoming webhook configuration ->
Chat should be reset to default department. Bot also will be set to default.
so that if the chat was closed, it will start in the originalDepartment A
with the original bot.
Trigger Configuration:
Department A
configuration to transfer chat to Department B
: