How to set primary email disable by default on preferences for some specific notification

Shivani Sahu
Tera Contributor

Hi Team, 

I have requirement to create email notification for assignment group member once SR task is assigned to them. But it should be allow to subscribed users whenever they needed. OOTB the notification preferences primary email is automatically enables to all the users. and we need to disable it for one particular group notification. This notification should be disable/unsubscribed to all users and they can be enable it through preferences as per their need.

 

How to set the primary email as disabled by default for one particular notification . Please help me on this to resolve soon. Screenshot has been attached for reference.

5 REPLIES 5

Thanks for giving your inputs but I need to disable the one notification "ULR_Task_assigned_group" to all the users by default not only for me or my profile that we can do by going notification preferences and disable it. But for all the users we will have to make it disable/unsubscribed

Riya Verma
Kilo Sage
Kilo Sage

Hi @Shivani Sahu 

Hope you are doing great.

 

To achieve the requirement of disabling the primary email by default for a specific notification in ServiceNow, you can follow these steps:

  1.  open "System Properties" --> glide.notification.email.default.unsubscribe" and set default value of the property to true. This configuration will ensure that the primary email notification is disabled by default for all users.

  2. create a business rule that targets the specific assignment group for which you want to disable the notification.

  3. In the "When to run" section, select the appropriate condition that will trigger the business rule. For example, you can choose to run the business rule whenever a task is assigned to a member of the specified assignment group.

  4. In the "Advanced" section, add the following script to disable the primary email notification for the targeted group:

 

(function executeRule(current) {
    // Check if the assigned user belongs to the specified assignment group
    if (current.assignment_group.getDisplayValue() == "Your Assignment Group Name") {
        // Disable primary email notification
        current.notification = false;
    }
})(current);

 

 
Please mark the appropriate response as correct answer and helpful, This may help other community users to follow correct solution.
Regards,
Riya Verma

Hi Riya, 
Thanks for update but my requirement is different, do not worried about the assignment groups it should be anything like once catalog task is assigned to any group then the notification would be triggered to all members on that group but the requirement was it will be trigger of those member in the group who have enable/subscribe the notification in preferences. 

But the notification under preferences is activated by default so all user will get that group notification. for that case we need to set as disable primary email of that particular notification "ULR_Task_Assignment_Group". That would be all the requirement.
.No need to filters on assignment group it should be anything we need to put the filter on that particular notification which should be disable by default so that the user will enable itself if needed on preferences.