07-31-2018 12:01 AM
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
Solved! Go to Solution.
08-15-2018 09:41 AM
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)
07-31-2018 09:38 AM
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... } }
08-15-2018 04:24 AM
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.
08-15-2018 09:41 AM
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)
09-25-2018 12:19 AM
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); }
09-25-2018 09:40 AM
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
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide