logo

NJP

Chat queue refresh with domain separation workaround

Import · Jul 02, 2015 · article

Hi,

One of our requirements from users was chat functionality. The problem with the Chat plugin in SNow is that it aparently doesn't support domain separation.

This workaround updates the queue every 5 seconds and plays a sound every time the queue count increases.

Updated chat queue:

image

Here's a POC for a simple workaround(in laymans terms - a hack):

1. Create a new Script Include (Client callable: checked, Name: "ChatUtils2"). See attached script - ChatUtils2.js.

2. Create a UI Script(Global: checked). See attached script - ChatQueueRefresher.js.

I presume the correct way to do this would have been using the SNows client-side events and have the Script Include return some XML to feed to the event system.

For example the response from xmpp ping with a new user added to the queue would be (the piles of 'x' are just sys_id-s):

<?xml version="1.0" encoding="UTF-8"?>114358367240003923000hi

I hope this document helps someone save some time.

Cheers.

View original source

https://www.servicenow.com/community/developer-articles/chat-queue-refresh-with-domain-separation-workaround/ta-p/2306864