Subscribable Notifications

Matt Benson1
Kilo Sage

I have read the wiki information on them (http://wiki.servicenow.com/index.php?title=Using_Subscription_Based_Notifications#Special_Subscripti...) and see that there is some special business rule magic going on to get them to work. I am not exactly sure what kind of magic that takes.

My requirement is fairly straight forward. We have a process to notify a group of people of work going on related to a P1 incident. I have a special field where "business language" is entered, a business rule to fire off an event when this field changes, and a notification to send out. Currently we have a distribution list configured in the notification and manage the members of it elsewhere. Everything works ok but we would like to leverage the power of Subscription Based Notifications to allow users to subscribe, unsubscribe, schedule and/or filter this notification on their own.

I have created a stand alone notification to try it out. Subscribable is checked and any "who will receive" info is blank. When subscribing to this new notification the event is fired but the notification is never generated.

Can anyone tell me the magic I am looking for to get a subscribable version of this notification to work?

4 REPLIES 4

NeilH2
Giga Guru

Add this script to the email notification/template that is sent.

It will generate a unsubscribe link on the email.



template.print('Click here to Unsubscribe from the "' + email_action.name + '" Notification
\n');


Matt Benson1
Kilo Sage

Thanks Neil, that will definitely be useful when I can get the notification to generate.

The specific issue I am trying to overcome is to actually generate the notification once the event is triggered. If I unselect Subscribable in the notification it gets generated, if it is selected it does not get generated. 😞


NeilH2
Giga Guru

I see what your doing.

Check your script logs for the event, it may be a parameter isn't being passed or the registry entry is incorrect.
If its still not sending check the condition on the email, and make sure there's an entry in the TO box.

Without seeing it i couldn't say, if you attached screenshots of the notification i could have a look.

FYI the link i used ignores the subscribable tick box (i never use it), all our users are subscribed to every email until they click that link.

Neil


CapaJC
ServiceNow Employee
ServiceNow Employee

tl;dr - I'd recommend making it a normal notification, sticking your custom group on it, and then anyone who doesn't like it can edit their notification preferences from their Profile to opt out.

Now for the longer explanation behind my recommendation. I think a subscribable notification might not be the right thing for this. Yeah, wow - from the wiki:
â—¾CI affected â—¾Location affected â—¾Cost center affected â—¾Group affected
These are the only notifications supported as subscribable in the out-of-box Email Notification form. Of these, only CI affected is completely functional.

Sure seems like an unfinished feature to me =P

Taking a quick look at the "Subscribe" UI Action, and the Script Include it references, I see that it looks at the cmn_notif_message table. Looking at that table, I see it has reference fields against cmdb_ci, cost center, location, and group tables. So I'm guessing these reference fields come into play when subscribing to a thing. No reference field against task, so Incidents aren't subscribable.

The script include also only seems to check for cmdb_ci subscriptions, which explains why the other three notifications are gelded.

I'd recommend simply making it a normal notification, sticking your custom group on it, and then anyone who doesn't like it can edit their notification preferences from their Profile to opt out.