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

Geoffrey2
ServiceNow Employee
ServiceNow Employee

Sounds like a weird problem.


I would try and figure out what is causing the blank updates by creating a Business Rule to do some logging.


Condition: current.comments.changes()


Script: gs.log('Comments have changed on ' + current.number + ' by ' + gs.getUserName() + '.\nComments: "' + current.comments + '"', 'Comments issue');



You can change the conditions on the Email Notification to prevent it from sending.   Can you post a screenshot of your Email Notification?


The out-of-the-box notification uses 'Send when' is 'Record is inserted or updated'.   But I've always found events to be more accurate for Email Notifications.   So you could switch to an Event-based trigger.


Hi Geoffrey,



Please have a look at the screenshots. The email is triggered by event.


comm1.PNG



comm2.PNG



Thanks,


Arnab


Geoffrey2
ServiceNow Employee
ServiceNow Employee

What does the code look like that is firing the sc_req_item.commented event?


Also Geoffrey, I am unable to reproduce this issue. This is also a reason I'm not able to solve this issue. This happens sometimes and anonymously, not every time.


Geoffrey2
ServiceNow Employee
ServiceNow Employee

There will be some reason behind it.   We just need to find it.