Playing a sound file when a ticket is assigned to your group

clivebushell
Giga Contributor

Hi,

My service desk would like a sound to play when a ticket is assigned to their resolver group, is there away to do this, I have located this information - Customize the Connect audio notification sound which seems to cover   - Audio file to play to notify users of new messages, support conversation transfers and @mentions in Connect. But not when a ticket is assigned to a resolver group.

Is there any way of making this happen?

Many thanks

Clive

6 REPLIES 6

Hey Ryan,

I also came across a similar kind of use case and here is a portal widget I created for the same which plays the sound every after a few sec. My use case is different but you will get a general idea about the setup.

 

widget Code: 

client script:

function($scope,$timeout,$interval,spUtil) {

var c = this;

var interval = $interval(function(){
c.server.update();
if(c.data.bpopup){
var sound = new Audio("connect_alert.mp3");
sound.play();
}
else{
$interval.cancel(interval);
}
}, c.data.timer);

}

 

Server script :

(function() {
/* populate the 'data' object */
/* e.g., data.table = $sp.getValue('table'); */
data.bpopup = false;
var gr = new GlideRecord('chat_queue_entry');
gr.addQuery('state','1');
gr.query();
while(gr.next()) {
data.timer = gs.getProperty('chat_sounds_timer');
data.bpopup = true;
}

})();

 

I hope it will help you with what you are looking for.

This is working on the portal, but I want to play sound on the platform and that is still a mystery.

 

Thanks,

Suraj

Hey Suraj, 

Thanks for this. I actually ended up getting it to work a bit differently, and finagled a way to get it to work in the backend UI (sort of).  See below for the widget code. I then added the widget to a portal page, and iframed that page on a dashboard. The user's who need to hear the sound have been told they just need the dashboard open on a tab - doesn't matter if it's active or not!

HTML:
<div class="{{::c.options.class_name}} wrapper" ng-if="c.options.table&&c.data.isAgent">  
 	<audio src ="connect_alert.mp3" id= "audio" />
</div>

Server:
(function () {
	data.isAgent = gs.getUser().hasRole('awa_agent')|| 
        gs.getUser().hasRole('interaction_agent'); 
})()

Client:
function ($scope,$window, spUtil,glideUserSession) {
	var c = this;
	if (!c.options.table)
		return;
	var userID;
	
	glideUserSession.loadCurrentUser().then(function(currentUser) {
			 userID = currentUser.userID;
	} );
    spUtil.recordWatch($scope, c.options.table, c.options.filter,function(name){
		if(name.data.changes.includes("assigned_to")){
			if(name.data.record.assigned_to.value == userID){
				var sound = document.getElementById("audio"); 
				sound.play();
				
			}
			else{
				console.log("DEBUG - client : assigned_to other user - NO SOUND" + name.data.record.assigned_to.display_value);
				
			}
		  
		}
	  });
}