If a user ends and rejoins a connect support conversation before it is accepted the Duration time of chat_queue_entry will be incorrect.

Steps to Reproduce


  1. Install the Connect Support plugin com.glide.connect.support.

    For more information, see the documentation topic Activate a plugin.

  2. Impersonate an end user and navigate to a Connect Support queue.


    For more information, see the product documentation topic Connect Support.

  3. Type an initial message and click Send to initiate a new support conversation.

  4. Click the red End Chat button.

  5. Click the link at the bottom of the window to rejoin the session.

  6. In a new window, log in as the Agent and accept the Chat and send a message to the user.

  7. Click the End Chat button to end the session.

  8. Navigate to chat_queue_entry_list.do and open the record for that conversation.

  9. Inspect the value of the Duration field.

    If the field does not appear, you may have to add it to the form or list.

    Note that instead of the duration of the record showing how long the agent has chatted with the end user, the duration will be something like 23:59:56, which is a whole day minus the time between the time the user left the chat and the agent accepted.


As a temporary workaround, use the work_end field on chat_queue_entry, which correctly reflects when the conversation was closed. You can also edit the SNC - Chat Queue Entry Duration Business Rule to use that in any case where the closed_at is before the opened_at.

The edited script for the business rule is as follows:

(function executeRule(current, previous /*null when async*/) {

var dateDiff;
var opened = new GlideDateTime(current.opened_at);
var closed = new GlideDateTime(current.closed_at);

// check if it was closed before it was opened.
if (closed.compareTo(opened) == -1){
dateDiff = gs.dateDiff(current.opened_at.getDisplayValue(), current.work_end.getDisplayValue(), false); 
} else {
dateDiff = gs.dateDiff(current.opened_at.getDisplayValue(), current.closed_at.getDisplayValue(), false);

current.calendar_duration = dateDiff;
})(current, previous);


Related Problem: PRB1030558

Seen In

There is no data to report.

Intended Fix Version


Safe Harbor Statement

This "Intended Fix Version" information is meant to outline ServiceNow's general product direction and should not be relied upon in making a purchasing decision. The information provided here is for information purposes only and may not be incorporated into any contract. It is not a commitment, promise, or legal obligation to deliver any material, code, or functionality. The development, release, and timing of any features or functionality described for our products remains at ServiceNow's sole discretion.

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2018-03-14 09:33:33