Email notification when comment is added

KajaP
Tera Contributor

hi Guys,

 

I would like to tweak my email notification that is fired when a comment is added in the request - condition used: 

KajaP_0-1738830012106.png

 

Currently it is sent out after any comment is added, to both employee (opened for) and the assigned to agent. They are therefore receiving emails also after they post a comment themselves... 😞 

 

I'd like the notification to be fired only when someone else adds a comment - how to achieve that?

 

Thanks in advance,

Kaja

1 ACCEPTED SOLUTION

fibssy
Tera Guru

OOTB there are two notifications. You may want to use the same concept.

 

  1. Incident commented for ITIL where the condition is set up Additional comment changes AND Sent to event creator is  unchecked. This email is sent to Assigned to and Watchlist. And will NOT be sent to the person who updated the incident.

fibssy_0-1738851449940.png
fibssy_1-1738851468012.png

2.  Then there is a second notification which is sent to the caller named: 'Comment left on incident' or 'Incident commented ' which is triggered by an event: incident.commented which runs the incident events business rule. This business rule containts the following script lines:

 

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

 

 

This business rule is designed to trigger an event when a comment is added to an existing incident (not during creation) and the context is not related to Connect. The event "incident.commented" is then queued with relevant user information. Also, the 'Send to event ceator is disabled in this notification, which prevents the user who updates the incident  to receive the notification.


Good luck.


Fibssy

View solution in original post

5 REPLIES 5

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @KajaP 

 

Try adding like this

 

AGLearnNGrow_0-1738850198755.png

 

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

fibssy
Tera Guru

OOTB there are two notifications. You may want to use the same concept.

 

  1. Incident commented for ITIL where the condition is set up Additional comment changes AND Sent to event creator is  unchecked. This email is sent to Assigned to and Watchlist. And will NOT be sent to the person who updated the incident.

fibssy_0-1738851449940.png
fibssy_1-1738851468012.png

2.  Then there is a second notification which is sent to the caller named: 'Comment left on incident' or 'Incident commented ' which is triggered by an event: incident.commented which runs the incident events business rule. This business rule containts the following script lines:

 

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

 

 

This business rule is designed to trigger an event when a comment is added to an existing incident (not during creation) and the context is not related to Connect. The event "incident.commented" is then queued with relevant user information. Also, the 'Send to event ceator is disabled in this notification, which prevents the user who updates the incident  to receive the notification.


Good luck.


Fibssy

KajaP
Tera Contributor

Hi Fibssy,

 

the first solution worked out - thank you very much for your help!

 

Kaja

Glad I was able to help. 

 

Have a great day.