how to stop sending mails to particular users

govardhantv
Kilo Contributor

Hi All,

we are in process of closing old tickets which is 3 years old ,when we close those incidents ,there will be mail sent to user ,can we stop these mails reaching user any way supress them ,and it is should not effect current business notifications...

Regards

Govardhan

9 REPLIES 9

Michael Ritchie
ServiceNow Employee
ServiceNow Employee

I would recommend closing out the old tickets via script.   You can create a fix script that closes the incidents but before your update() statement, use setWorkflow(false) and this will prevent business rules, workflows, and notifications from going out:


http://wiki.servicenow.com/index.php?title=GlideRecord#setWorkflow



Now this said if there is auditing, metrics, slas, etc that you also want to "close out", then using setWorkflow() won't correct those.


Hi Micheal,



Are you sure that setWorkFlow prevents notification from going out ?



In the wiki it's written "Enables or disables the running of business rules that might normally be triggered " but there is not nothing about notifications.



Thanks you in advance



Best regards,


Hamza


Hamza, setWorkflow() stops all background processes from running.   I would say that "disables the running of business rules" includes the notification engine, workflows, etc.   I would suggest testing this in a test instance before attempting it in production just to be sure your script runs as you want it.


Thank you Micheal, that's what I am going to do



Have a good day


akaupisch
Kilo Guru

I would not disable the notifications, you'll lose all notifications you do want during this time. What I would do is go to the notification(s) in question and put a condition on them...something along the lines of 'opened is less than 1 year from today'. This will prevent any notifications that are over a year old from sending for that notification.