Connect Support chat sessions which continue after incident creation result in emails sent for each subsequent connect message


If you create an incident from Connect Support, but continue with chat activity with the end user, an email message is generated for each chat update. These email messages are not necessary.

Steps to Reproduce

1) Initiate a Connect Support chat queue session with a user

2) Create an incident from the connect chat session

3) Continue chatting back and forth within the connect session

4) Review the email log and note that each message creates an incident.commented email

Connect chat should allow for decoupling of those messages. This could for example be handled by submitting a different event instead of incident.commented to allow email messages to be excluded for continued chat activity.


This problem has been fixed. If you are able to upgrade, review the Fixed In section to determine the latest version with a permanent fix your instance can be upgraded to.

As a workaround on earlier versions, check the transaction that is triggering the update to the comments of the incident. If it is from a Connect API, then that specific notification should not be sent. This can be done by making simple modifications to the business rule creating the events. In a base system instance, the business rule responsible for the behavior is named "incident events." The following steps explain how to change the "incident events" business rule to correct the issue.

  1. Navigate to the "incident events" business rule

  2. Add the following new "getPath" function at the bottom of the script after all other lines of code:

    function getPath() {
    var transaction = GlideTransaction.get();
    if (!transaction)

    var req = transaction.getRequest();
    if (!req)

    var path = req.getRequestURI() || "";
    return path;

  3. Locate the lines of code that are creating the "incident.commented" event. In a base system instance, this code appears at the very top of the business rule as follows:

    if (current.operation() != 'insert' && current.comments.changes()) {
      gs.eventQueue("incident.commented", current, gs.getUserID(), gs.getUserName());

  4. Edit the code above so it reads as follows:

    // Changes below are to work around PRB681459. All this is doing is verifying the
    // transaction which triggered the business rule was a connect transaction using a regex.

    if (current.operation() != 'insert' && current.comments.changes()) {
    var path = getPath() || "";
    if (!path.match(/\/api\/now\/connect/))
    gs.eventQueue("incident.commented", current, gs.getUserID(), gs.getUserName());

  5. Save the business rule. 

    NOTE 1: if the connect API call changes in a future release then the business rule needs to be updated to check for that call instead.

    NOTE 2: The notifications for incident commented may use a condition (comments.changes) instead of the incident.commented event, and if this is the case, you need to change them to use the event instead. 

    1) Navigate to System Notification > Email >Notifications
    2) Search for the Name contains "incident" and "comment"
    3) Switch to the advanced view if needed
    4) In the when to send section, change "send when" to be Event is fired 
    5) Since the event name should already be set in the OOB notifications you just need to save the Notification.

Related Problem: PRB1374111