cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1238
Views
0
Helpful
5
Replies

Cisco Finesse Javascript API: user.getQueues() get Agents ready statistics

jozefnad
Level 1
Level 1

Hello, I want to make simple 3rd party gadget with just Agents ready number - similar to QueueStatistics, but just agents ready state in queue.

 

I tried getQueues(), but it shows me just [object Object] and I am not able to read data from that. When I use queue.getStatistics() it does not run my gadget at all.

 

Can you help me, how I should use JS library to show agents ready number?

 

Thank you 

1 Accepted Solution
5 Replies 5

dekwan
Cisco Employee
Cisco Employee

Hi,

 

Take a look at the documentation here: https://pubhub.devnetcloud.com/media/finesse/docs/guides/javascript-library/symbols/finesse.restservices.Queues.html

There is an example on how to use it:

 _queues = _user.getQueues( {
     onCollectionAdd : _handleQueueAdd,
     onCollectionDelete : _handleQueueDelete,
     onLoad : _handleQueuesLoaded
 });
 
_queueCollection = _queues.getCollection();
for (var queueId in _queueCollection) {
    if (_queueCollection.hasOwnProperty(queueId)) {
        _queue = _queueCollection[queueId];
        etc...
    }
}

Thank you for your help, it works good with REST calls, but the example you gave me works just the first time, when website is loaded. When there is change on queues, values do not change.

Hello, I was working on solution with REST which works good for me with refresh interval of 5s.

But I want to use javascript library and as I mentioned you, it works only when user load. No more.

Can you tell me what to add into code (no external link to see).

 

Thank you

 

    handleUserLoad = function (user) {
        user.getQueues( {
            onCollectionAdd : queueHandler,
            onCollectionDelete : queueHandler,
            onLoad: queueHandler
        });
    },
   
    queueHandler  = function(data) {
    	queues = data.getData().Queue;
    	str = "";
    	queues.forEach(function(e) {
    		clientLogs.log(e);
   		str += e.name + " - " + e.statistics.agentsReady + "<br />";
    	});
    	$("#window").html(str);
    }

 

Hi,

 

Did you see my previous reply?

 

In the _handleQueueAdd handler, add an on change handler (https://pubhub.devnetcloud.com/media/finesse/docs/guides/javascript-library/symbols/finesse.restservices.RestBase.html#addHandler) 

 

Also, your "queueHandler" should probably be different for the add and the delete.

 

Thanx,

Denise

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: