System updating the additional comments field which triggers blank emails
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2016 09:08 PM
Hi SNOW Enthusiasts,
I have been facing a problem for quite a while now which my client is complaining of and I still could not find a way to resolve.
The Story is :
When ever a Request item/incident ticket is commented, a mail notification is triggered to requester. Lately I have observed that the system is changing the additional comments even if it is blank and as a result sends an email to the requester. I have seen this issue a numerous time now where the comments are updated (totally blank) and then triggered a notification.
How can we stop this update of blank additional comments OR what may be the reason that a blank comment is updated?
Thanks,
Arnab
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2016 09:45 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2016 09:49 PM
See if the following condition helps:
current.comments.changes() && current.comments.trim() != ''
This should ignore updates where the comments are blank.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2016 09:54 PM
Use gs.isInteractive() in your BR Conditions. You dont need the code at the
bottom where you are checking if the current user is a member of the
assignment group. Instead you can use gs. getUser().isMemberOf(current.
getValue('assignment_group')).
On Monday, September 5, 2016, geoffrey.sage <community-no-reply@
servicenow.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2016 09:57 PM
Thanks for the suggestion Geoffrey. Since the issue is not producible manually so I'm using your line of code in condition area and now I just have to wait for the issue to arrive again or I need to monitor everyday. If the issue does not show up for a week or two then I would reply my client that the issue is resolved and also let me know if it shows up again.
Also Geoffrey, I know the working of trim() but could you please tell me what actually you are doing with current.comments.trim() != '' :
Thanks,
Arnab

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2016 10:07 PM
Trim cuts the white space off the start and end of the string. So I use .trim() != '' to exclude empty strings and any string that is only made up of white space, like a single space character " ". Basically I'm not assuming that the update is empty, but may contain a space character.