- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-07-2019 09:14 AM
My customer would like to have a visual or sonor notification when a new record is inserted in a custom table.
The reason behind is that the agent working on this custom table need to be alerted in real-time when a new record is inserted, in order to take the necessary actions as fast as possible (e.g. Root cause analysis, solution finding, issue resolution). The user would not always be in front of the ServiceNow instance. That is why he needs to be alerted with a visual or sonor notification when he is focused on something else (e.g. need to be notified if he is currently in an excel spreadsheet).
I know that when we use the Connect feature, there is a visual and sonor notification: the receiver of the connect chat message would received a browser notification (see attached file browser_notification.JPG) and also a sonor notification if the servicenow is opened a browser, but the focus is somewhere else.
So I was wondering if it was possible to trigger this kind of visual/sonor notifications (browser notification) other than than sending a connect chat message. Exemple: the trigger would be the insert of a new record.
Related threads on the community
Running ServiceNow without Email integration
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-01-2019 11:50 PM
Thanks to my friend Hamza and a conversation I had with my friend Didier, I have finally 2 workarounds to solve the requirement:
1. Use Flow Designer with the action Add Group Users to Task Conversation
or
2. Create a business rule and user the Conversation API
Both solutions will create a Connect conversation, which end up notifying the user with a browser notification.
Both solutions have pros and cons. Let met explain with this simple use case: Notify the assignment group when the incident priority changes to 1 - Critical.
1. Use Flow Designer
Create a Flow with this confiugration
Trigger
Trigger: Created or Updated
Table: Incident [incident]
Condition: Priority | changes to | 1 - Critical
Run Trigger: For each unique change
Actions
Action: Add Group Users to Task Conversation
Task Record [incident]: Trigger -> Incident Record
Group [group]: Trigger -> Incident Record -> Assignment Group
Result
Pros
Really easy to set up (no code confiugration).
The conversation is linked to the target record.
Cons
The delay to display the browser notification is variable. Average, 10 seconds, but sometimes is 20 seconds, sometimes, 3 seconds...
2 Create a Busines rule and use the Conversation API
Create a business rule with this configuration
When: After Insert / Update
Condition: Priority | changes to | 1 - Critical
Script:
//initiate conversation with incident number as conversation name
var conversation = sn_connect.Conversation.create({
name: current.getValue('number'),
type: "connect"
});
//Retrieve active members of the assignment group
var groupMember = new GlideRecord('sys_user_grmember');
groupMember.addQuery('group', current.getValue('assignment_group'));
groupMember.addQuery('user.active', true);
groupMember.query();
//Add each member to the conversation
while(groupMember.next()) {
conversation.addSubscriber(groupMember.getValue('user'));
}
//Add the link of incident in the conversation
conversation.sendMessage({
body: current.getLink(),
field: 'system'
});
Result
Pros
No delay to display the browser notification (almost instantaneous!).
Cons
Need scripting skills to do the setup.
The conversation is not linked to the target record
Conclusion
If you requirement is to have an instant browser notification (because it is critical for the business to go this fast), go with the business rule solution.
Otherwise, if it is okay to have a 10 seconds delay, go for the Flow Designer solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-26-2019 05:21 AM
Hi ,
Can we implement same workaround for Agent Workspace chat instead of connect?
Becasue currently we have only alert message in AWS homepage when a new chat request is coming...SO if support agent is in another page, he wont be aware about the incoming chat request...Please help.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-26-2019 07:40 AM
Hi Saranya, actually I never used Agent Worspace chat. I don't have the answer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-08-2020 06:58 AM
Hi,
In 2 nd method, only BR is required? or any other configurations?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-07-2020 08:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2019 04:20 PM
Hi Ximizu,
Any idea how we can post system message through this solution? As you can see the notification which gets generated doesnt give proper description telling that P1 incident has been created instead it gives notification when a new group chat has been created.
field: 'system'
The above attribute doesnt create a system message.