Duplicate work note notifications sent out when work notes are generated rapidly

Chris Petrone
Tera Expert

We are having an issue with duplicate work note notification emails getting sent out in a specific scenario.

We use Remote instance spoke.

When we trigger a task on our end to send over to the remote instance, this is when our issue starts.

The remote instance is programmed to work note most of their updates to their tickets. These work notes get sent to our task. 

So for example: remote instance types a work note into their field, and also makes a change to the state of their ticket, clicks on Save record. The change on their end triggers a work note to be printed, which gets sent to our instance. 

1 work note get printed stating the remote instance has changed their state, since we want to know when that happens, and a second work note is printed on the actual work note typed up.

This comes through as 2 work notes on our end within 0-2 seconds of each other.

We now have an email notification that gets triggered any time a work note is added to the task, and gets sent out to the assigned to user. Because the work notes have come through so quick, the email notification sends out an email for 2 work notes, since there were 2, but it only grabs the last work note on the task, making it look like duplicate notifications got sent. The notification is not fast enough to get the first work note when work notes come through in quick succession.

 

What would be a good solution for this? ServiceNow states "email notification is working as expected.
Due to the fact that all the changes to the task occur simultaneously, using RIS, on your local instance.
The work_note gets added to the email notification using the value of the most recent entry in the work_notes.
At the time that both notifications were triggered, the work notes had already been updated with all the updates, but only the most recent is added into both the notifications."

6 REPLIES 6

Yes I see what you are saying. We don't want anything from them to be additional comment and viewable to our end user as our organization decided that our org is responsible for communication with end user and not the remote org.

I believe if you can make one change at remote instance logic of replicating their actual work notes to your instance's work notes as appending keyword at the end or beginning of the actual work note like "WorkNoteFromRemoteInstance", then you can apply a logic like mentioned below. This will then trigger e-mail notification only for such work notes and not others:


if (current.comments.changes() && current.comments.getJournalEntry(1).indexOf("WorkNoteFromRemoteInstance") === -1) {
your logic here
}

Hope that helps!