chat queue routing

abhinav_khanna
Kilo Expert

Hi all,

 

On the ess portal I want to give a custom link on the page which when clicked opens up the "chat" dialog box and the chat is routed to the correct assignment group based on the users country.
Any idea how to achieve that. I can not hard code the sys_id in the chatqueue function. I want something dynamic which pops up the end user chat on Click.

 

 

Regards
Abhinav Khanna

1 ACCEPTED SOLUTION

TrevorK
Kilo Sage

My initial thought would be that you want to create an "inbetween" piece that either accepts their country as input or takes one from their profile. This piece then redirects to the appropriate Chat Queue based on the result.



While I am not a CMS expert, my thoughts are that a simple way to do this would be through a dynamic content block. The user would enter their country (defaults to their profile country maybe?) and click Chat. The code in the background would then determine the appropriate Chat Queue to send it to and then just redirect to the chat queue link.



We only have one Chat Queue, and we fire it through our dynamic content block in this fashion:


      CustomEvent.fire(LiveEvents.LIVE_EVENT, LiveEvents.LIVE_WINDOW_JOIN_QUEUE_QUERY, 'CHAT_QUEUE_SYS_ID','CHAT_QUEUE_NAME');


I see no reason why there could not just be a little logic before to determine which Chat Queue to fire into.



On the surface, this does not seem too challenging to develop from a technical point of view, however what will be challenging is the UI/UX around this feature.



I am sorry I do not have the code developed for this, as we only use the one Chat Queue but I hope this helps. If you need anything else please post back.


View solution in original post

56 REPLIES 56

TrevorK
Kilo Sage

My initial thought would be that you want to create an "inbetween" piece that either accepts their country as input or takes one from their profile. This piece then redirects to the appropriate Chat Queue based on the result.



While I am not a CMS expert, my thoughts are that a simple way to do this would be through a dynamic content block. The user would enter their country (defaults to their profile country maybe?) and click Chat. The code in the background would then determine the appropriate Chat Queue to send it to and then just redirect to the chat queue link.



We only have one Chat Queue, and we fire it through our dynamic content block in this fashion:


      CustomEvent.fire(LiveEvents.LIVE_EVENT, LiveEvents.LIVE_WINDOW_JOIN_QUEUE_QUERY, 'CHAT_QUEUE_SYS_ID','CHAT_QUEUE_NAME');


I see no reason why there could not just be a little logic before to determine which Chat Queue to fire into.



On the surface, this does not seem too challenging to develop from a technical point of view, however what will be challenging is the UI/UX around this feature.



I am sorry I do not have the code developed for this, as we only use the one Chat Queue but I hope this helps. If you need anything else please post back.


Brad Tilton
ServiceNow Employee
ServiceNow Employee

I've done this before with the following steps:



  1. Your chat button redirects to a custom chat cms page.
  2. That chat page has an onload function that takes a look at the logged in user's location and loads the correct chat queue based on that location. This could be hardcoded into the script or, even better, in a lookup table.

Hey
Both the replies are correct.
I achieved it using both the ideas but the use of a dynamic content block gave a much better outlook and solved my purpose to the point.
Thank you Trevor and Brad



Regards
Abhinav Khanna


Hi Abhinav,



Might you share the code for the custom UI Page and onLoad function solution that Brad recommended?



Thanks for sharing,



John