How do I manage what notification preferences people see?

igeekforyou
Kilo Expert

OOB there are a ton of notification options for folks to enable/disable. Can someone share where I might be able to limit the areas that folks can turn on/off their notifications.

Capture.PNG

1 ACCEPTED SOLUTION

igeekforyou
Kilo Expert

Here is what I found on this topic after great discussion here: While neither of these actions allow to "hide" the notification preference, it at least lets you control who can subscribe and unsubscribe.



There are two options for notifications (Force and Mandatory) that will determine how the notifications appear to the end user. I would like for the



In Geneva


Forcing will force the notification no matter what the user has set as their notification preference.


http://wiki.servicenow.com/index.php?title=Email_Notifications#gsc.tab=0 | 2.6



Setting as Mandatory will set the notification as mandatory, but will allow the user to unsubscribe from the notification if desired.


http://wiki.servicenow.com/index.php?title=Setting_Up_Subscription_Based_Notifications#Making_a_Noti...



In Helsinki


Forcing - https://docs.servicenow.com/bundle/helsinki-servicenow-platform/page/administer/notification/task/t_...


Mandatory - https://docs.servicenow.com/bundle/helsinki-servicenow-platform/page/administer/notification/task/t_...




View solution in original post

21 REPLIES 21

I am curious what modification you made to only return notifications received by the user. Would you be able to share that? I have modified this Script Include so that 'subscribable' notification do not appear with the standard notifications and being able to filter the rest like they used to be would be awesome.

Instead of querying "sysevent_email_action" table directly, query "cmn_notif_message" table which obviously stores notifications received at least one by a user.

var notifMessageGR = new GlideRecord('cmn_notif_message');
notifMessageGR.addQuery('user', userId);
notifMessageGR.addQuery('notification.active', true);
notifMessageGR.orderBy('name');
notifMessageGR.query();

Then you get the actual notification in while loop via var notification = notifMessageGR.notification; and you use notification instead of gr variable in the rest of the function code. (I recommend to create new function "gatherReceivedNotifications" instead of updating the "gatherNotifications" and use this in "gatherNotifPreferenceData").

That should be it.

Anyone tested this with UI16??

Yes. Doesn't work with UI16.

Hello Dominik Simunek,

Thanks for the solution ,could you please provide us the code as well which you already tried to get the notifications.

It will be very helpful for me for my requirement .

 

Regards,

Namrata Agrawal