The Zurich release has arrived! Interested in new features and functionalities? Click here for more

Notification set to 'Off' by default

aedwards
Kilo Explorer

Hi,

I've been asked to create a email notification (when an incident is assigned to you) for all the support people but switched off by default, so that they can turn it on themselves if they want it.

I've written the JavaScript to create the notification, for one user so far for testing, but I can't get it to be 'off' by default. cmn_notif_message doesn't have an Active field, and I've tried setting send_email=False.

Can someone please give me some pointers as to where I need to look.

I've attached my script, and the flag I'm trying to set.

Thanks.

Alan.

5 REPLIES 5

ShaneBrazeal
Tera Contributor

Hi Alan,

It looks like you have to set notification_filter (reference to notification_filter) to the sys_id of the "Unsubscribe" record on notification_filter, on demo it is 'c1bfa4040a0a0b8b001eeb0f3f5ee961'.


aedwards
Kilo Explorer

Thanks, that's sorted it.

Alan.


JenniferS1
Kilo Contributor

For some reason I am not able to see your attachments. I found the Notification Filters under System Policy that Shane mentioned, but can you please tell me where exactly you added this? Is it in a script or condition somewhere? I checked to see of "Notification Filter" was available if I personalized my form, but it wasn't. Thanks!


aedwards
Kilo Explorer

I was creating the notification subscriptions in a background script, so I had to look up the sys_id of the 'Unsubscribe' notification filter record, and then set the notification_filter field on the new cmn_notif_message record to that sys_id.

I've attached the entire script, but this snippet is how I got the filter record:

// Get reference to Unsubscribe notification filter
var filterRec = new GlideRecord('notification_filter');
filterRec.addQuery('name', 'Unsubscribe');
filterRec.query();
filterRec.next();

If you're doing it through the front end, you set the filter by going to the notification preferences in the user's profile and turning the notification off.

Alan.