385 views

Description

When closing a chat session on an end user's side, the chat does not get moved into the Close_Complete state. Instead, it remains in the Waiting state.

Steps to Reproduce

  1. Start a Support conversation.
  2. As the end user, click End chat.

    Note that the state does not change to Closed_Complete.

Workaround

  1. At a time when your chat queues are not active, set all existing chat_queue_entry records to Closed_Complete by running the following script in Background Scripts:

    var acceptedEntries = new GlideMultipleUpdate("chat_queue_entry");
    acceptedEntries.setValue("state", "3");
    acceptedEntries.execute();

  2. Create the following business rule to set the chat_queue_entry to Closed_Complete when the chat_room is closed:

    Table: Chat Room [chat_room]
    When to run: After Update
    Advanced condition: current.state == 'closed'
    Advanced script:
    (function executeRule(current, previous) {
    var chatQueueEntryGR = new GlideRecord('chat_queue_entry');
    if (!chatQueueEntryGR.get(current.chat_queue_entry))
    return;

    chatQueueEntryGR.state = 3;
    chatQueueEntryGR.action = 'abandoned';
    chatQueueEntryGR.closed_at = new GlideDateTime();
    chatQueueEntryGR.closed_by = GlideSession.get().getUser().getID();
    chatQueueEntryGR.update();
    })(current, previous);


Related Problem: PRB676159

Seen In

Fuji Patch 11
Fuji Patch 13 Hot Fix 1
Fuji Patch 8
Geneva Patch 3
Geneva Patch 3 Hot Fix 9
Geneva Patch 4
Geneva Patch 4 Hot Fix 9
Geneva Patch 5
Geneva Patch 6
Geneva Patch 6 Hot Fix 6
Geneva Patch 7
Helsinki Patch 0 Hot Fix 1
Helsinki Patch 1
Helsinki Patch 1 Hot Fix 1
Helsinki Patch 8

Fixed In

Geneva Patch 3 Hot Fix 10
Geneva Patch 8
Helsinki Patch 2
Istanbul

Associated Community Threads

There is no data to report.

Article Information

Last Updated:2018-03-06 13:41:03
Published:2017-06-19