How to stop the insertion of the notification message record?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2022 12:27 AM
Hi Team,
I have notification "Incident commented for ITIL" with the related lists notification messages.
Currently the related list shows two records tagged to two users.
How can I stop the creation of a record for the first time for a user without turning off the "allow notifications"?
For eg. If a user named David haven't received this email before and if the condition satisfies he might receive it if he is a caller but I wanted it to be stopped before having created as notification messages because we have few configurations related to this in the form.
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2022 07:57 AM
https://community.servicenow.com/community?id=community_question&sys_id=ffdd03aadb25c11007ab826305961907
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-14-2022 12:51 PM
Hi, 'cmn_notif_message' is populated after a message is triggered to a user, IE after the trigger conditions are met.
Can you clarify why you are trying to remove this entry, and the benefits/functionality you expect as a result?
If you have dependencies\form values related to triggering of the notification,
then perhaps they could be added to the notification conditions/triggers, so that a notification is only sent when the conditions match?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2022 07:09 AM
Hi Tony,
Thanks for your response.
We have a checkbox as "Disable Notification" which is visible for specific users for time being until they update the record. So when that's checked, the caller shouldn't receive any notification.
I was able to turn off the notification preferences, module specific using a script.
But if incase, there is any new notification that the caller is receiving for the first time it gets added to the preferences and also gets triggered.
So even the new notification should not be triggered when checkbox is checked.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-15-2022 11:04 AM
Hi, you don't make it clear where your checkbox is, user record or task (your screenshot shows incident)?
If a notification is triggered for a user then the notification\user combination will be added as a record in 'cmn_notif_message', removing the entry will not prevent the notification from being triggered again for the same user and when this occurs a new 'cmn_notif_message' record will be created and rather than deleting the entry it's filter should be set to unsubscribe.
If you do not want a user to receive a notification, then a "Disable notification ' flag on the active record (IE a task) will allow you to dot.walk to the true\false value in your notification trigger conditions and as long as the notification is configured to send only 1 reference field (IE opened by) BAU functionality for other users will not be impacted.
If you want to prevent users from receiving a specific notification until someone decides they should receive it?
An option could be a script to add all of the relevant notification\user combinations to 'cmn_notif_message' with the filter for each entry set to 'unsubscribe'
You could trigger this on user creation, addition of primary email or when certain roles or groups are applied to the user. you could then update the filter to enable the notification based on another change in the environment.
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB0750584