Provider notification does not send to group

ehgebla
Giga Guru

Hi everyone, 
I have no idea what the issue here might be, but we started setting up provider notifications (to get rid of mails for our agents) and all of them are working fine when they'll be send to one user (e.g. mentioned by, additional comment/work note added to record etc).

What we now want to have is the simple notification when a new record arrives in one of their groups but is unattended. I used the exact same parameter as for our email notification, and added "Recipients listed in field" > Assignment Group.

Cap1.PNG
Content Class is set to Next Experience.

However, no notification is to be shown by the bell. The trigger is somehow successfully working it seems, as far as I can see in the log.


We're getting the following in the logs for the execution:

 

For Synchronous Providers: Loaded 1 recipients and 0 destinations and delivered to 0 destinations in 4ms

For Synchronous Providers: 'INC: Assigned to group' do not have any associated Common Content or Provider Content or Default Content for the Provider 'Workspace', this provider will not be initialized.

For Asynchronous Providers: Loaded 1 recipients and 0 destinations and delivered to 0 destinations in 4ms

 

Can someone help me out?



1 ACCEPTED SOLUTION

 

(function executeRule(current, previous /*null when async*/ ) {

    gs.eventQueue('testEvent', current, getGroupMembers(current.assignment_group), current.number);

})(current, previous);

function getGroupMembers(groupID) {
    var groupArr = [];
    var groupMemberGR = new GlideRecord('sys_user_grmember');
    groupMemberGR.addQuery('group', groupID);
    groupMemberGR.query();
    while (groupMemberGR.next()) {
        groupArr.push(groupMemberGR.user.sys_id.toString());
    }
	var stringArray =  groupArr.join();
	
	return stringArray;
}

 

Have a go with the above, this is the business rule script (just replace the eventname "testEvent" with your own). The condition  I set was just when assignment group changes.

 

The event log looks like this when triggered:

Rhodri_0-1693485925406.png (note all the user sys_ids, comma separated in parm1).

 

Rhodri_1-1693486000470.png

 

Rhodri_2-1693486040061.png

Looking at the logs above it looks to be working

Rhodri_3-1693486650370.png

 

 

Let me know if any luck/still issues. This is for the notification bell notifications right? (workspace experience > administration > notification triggers)

 

View solution in original post

12 REPLIES 12

Rhodri
Tera Guru

Hi,

 

This likely won't work as the "recipients listed in fields" is expecting (I assume) either a reference to a user record (like Assigned_to) or an email. When you set it to assignment group it's just getting the sys_id/reference to the group record and isn't clever enough to know you mean the group members.

 

The only way I think you could potentially do this is drive it by an event (instead of record change). So a business rule could insert the event into the event queue and you could pass a comma separated list of the group members in eventParm1.

 

In this community discussion here -  the comment from Bryan Tay3 at the bottom is probably most helpful.

How to send to send notification to group members ... - ServiceNow Community

 

Cheers 🙂

Cheers Rodri, thanks for the fast reply. 

However, I tried it with using an event today and just couldn't get it to work. Business Rule fires the event, I can see that much, but whatever I add to param in the script, also whatever I try to filter there, in the event log I can see that the event literally ALWAYS return 

Parm1 
Old Assignment Group
Parm 2
New Assignment Group

expect i hardcode what shall be in there. I am getting insane, why does the provider notifs not work out like the normal ones? The normal ones get all assignment group members just fine...

 

(function executeRule(current, previous /*null when async*/ ) {

    gs.eventQueue('testEvent', current, getGroupMembers(current.assignment_group), current.number);

})(current, previous);

function getGroupMembers(groupID) {
    var groupArr = [];
    var groupMemberGR = new GlideRecord('sys_user_grmember');
    groupMemberGR.addQuery('group', groupID);
    groupMemberGR.query();
    while (groupMemberGR.next()) {
        groupArr.push(groupMemberGR.user.sys_id.toString());
    }
	var stringArray =  groupArr.join();
	
	return stringArray;
}

 

Have a go with the above, this is the business rule script (just replace the eventname "testEvent" with your own). The condition  I set was just when assignment group changes.

 

The event log looks like this when triggered:

Rhodri_0-1693485925406.png (note all the user sys_ids, comma separated in parm1).

 

Rhodri_1-1693486000470.png

 

Rhodri_2-1693486040061.png

Looking at the logs above it looks to be working

Rhodri_3-1693486650370.png

 

 

Let me know if any luck/still issues. This is for the notification bell notifications right? (workspace experience > administration > notification triggers)

 

You have literally saved my day, this works like a charm! Thank you so much!