System updating the additional comments field which triggers blank emails

arnabwa
Giga Guru

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

18 REPLIES 18

Hello Geoffrey,



Have a look at the business rule that triggers the event. It is an After BR on update :


comm4.PNG


Script :


comm3.PNG



Thanks for your concern.


Geoffrey2
ServiceNow Employee
ServiceNow Employee

See if the following condition helps:


current.comments.changes() && current.comments.trim() != ''


This should ignore updates where the comments are blank.


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


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


Geoffrey2
ServiceNow Employee
ServiceNow Employee

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.