The Department class currently has these methods:
We recommend adding a method for detectVisitorDepartment().
Here is our use case:
We are using Triggers to set the visitor department on chat widget load. We are conducting chat across widely varying time zones, and on many different web sites. The department trigger makes sure visitors to our site are directed to the correct group of agents, and we use the trigger instead of the JS API to allow the business to configure the department routing in case needs change / we merge or split departments based on volume / etc.
However, we also use these directions to route chats based on department online status: https://chat.zendesk.com/hc/en-us/articles/218624817-Recipe-Automatically-route-chats-based-on-department-online-status
A key part of the instructions at that link is to use getDepartment() method to get the department status for the desired department. This is highly useful when the developer of the JS API knows which department the user should be chatting with.
However, if the CS business wants to retain control of the routing, they may wish to set department via Trigger instead of via the JS API. In that case, the developer cannot use getDepartment() to check department online status.
The solution to this is providing a detectVisitorDepartment() method that the developer can use to check the department the visitor has currently selected. This would allow the customer service admin to set the department via trigger, then the chat account status will be set via the JS API.
It might be necessary to include a new callback method too - setOnConnected will not work as it seems it would fire before the trigger sets the department. Maybe a new method for setOnTriggered?
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.