Hi together,
I've made some test and get struggling about the result....
I want to archieve to evaluate the amount of agents that are at state "on queue" for a dedicated queue (regardless if they are busy with an interaction or idle).
Test 1)
Every one is logged out of Genesys Cloud.
Result:
{ "results": [ { "group": { "queueId": "8e9a2fb2-xxxx-xxxx-xxxx-aef40ce7f820" } } ] }
-> That's OK
Test 2)
I am assigned to a queue and I am the only one.
I am logged in but not "on queue".
Result:
{ "results": [ { "group": { "queueId": "8e9a2fb2-xxxx-xxxx-xxxx-aef40ce7f820" }, "data": [ { "metric": "oOnQueueUsers", "qualifier": "INTERACTING", "stats": { "count": 1 } } ] } ] }
-> Why do I get a count of "1" interacting user?
Test 3)
I am assigned to a queue and I am the only one.
I am logged in and I am "on queue".
Result:
{ "results": [ { "group": { "queueId": "8e9a2fb2-xxxx-xxxx-xxxx-aef40ce7f820" }, "data": [ { "metric": "oOnQueueUsers", "qualifier": "INTERACTING", "stats": { "count": 1 } }, { "metric": "oOnQueueUsers", "qualifier": "IDLE", "stats": { "count": 1 } } ] } ] }
-> Now I have one interacting user and one idle user. The idle user is correct, but not the interacting one.
Test 4)
I am assigned to a queue and I am the only one.
I am logged in, I am "on queue" and I am in a active ACD call.
Result:
{ "results": [ { "group": { "queueId": "8e9a2fb2-xxxx-xxxx-xxxx-aef40ce7f820" }, "data": [ { "metric": "oOnQueueUsers", "qualifier": "INTERACTING", "stats": { "count": 2 } } ] } ] }
-> Now I have two (!) interacting user.
Do I have a wrong understanding of:
- an assigned user: assigned to a queue
- an "on queue" user: user is ready to receive ACD interactions
- an "interacting" user: user is at an ongoing interaction
???
THANKS for clarification.
BR, Robert
------------------------------
Robert Herms
Arvato Systems GmbH
------------------------------
Original Message:
Sent: 04-28-2022 07:46
From: Matt Lawson
Subject: In-Queue Agent Count
Excellent! Love hearing that. Thanks, @Thomas Repking!
------------------------------
Matt Lawson
Genesys - Employees
Online Community Manager
Original Message:
Sent: 04-28-2022 05:11
From: Thomas Repking
Subject: In-Queue Agent Count
This threat really helped me to get this topic done for my flow. Thanks alot!
------------------------------
Thomas Repking
Canada Life Group Services Limited
Original Message:
Sent: 02-18-2022 13:37
From: OMRI ZVIELI
Subject: In-Queue Agent Count
Hi Matt,
That's awesome! Thx guys,
I will sure give it a try next week.
Great weekend,
Omri
------------------------------
OMRI ZVIELI
TSG IT Advanced Systems Ltd
Original Message:
Sent: 02-17-2022 19:57
From: Matt Lawson
Subject: In-Queue Agent Count
Hey @OMRI ZVIELI and @Patrick Rohlf, Sam did a great demo of this topic in our latest episode of the Q&A Show. Check out the segment at the 12-minute mark.
------------------------------
Matt Lawson
Genesys - Employees
Online Community Manager
Original Message:
Sent: 02-16-2022 02:10
From: OMRI ZVIELI
Subject: In-Queue Agent Count
Hi Patrick,
Correct, I want to get the total number of all users that are currently logged in to the system and Assigned to a specific Queue.
The business goal for the customer is to check if there are any agents that are relevant to get the call before transfer it to the queue,
if no, then transfer it to a fallback queue with possibly much more agents.
Best,
Omri
------------------------------
OMRI ZVIELI
TSG IT Advanced Systems Ltd
Original Message:
Sent: 02-15-2022 17:07
From: Patrick Rohlf
Subject: In-Queue Agent Count
Omri,
So, you're saying that your end-goal is to: "Get a list of users, independent of status, that are logged into a specific queue. at a specific moment in time". Is that an accurate breakdown of what you are trying to achieve?
------------------------------
Patrick Rohlf
Summit Broadband
Original Message:
Sent: 02-15-2022 14:53
From: OMRI ZVIELI
Subject: In-Queue Agent Count
Hi Patrick,
Thanks for that!
Actually what I want to achieve is to get only the Queue members that are currently logged in (no matter what is there status) for a Flow decision,
I changed the Body Template to use oUserPresences and the translationMap to filter != 'OFFLINE' users.
Any idea how to filter the output to get it in a total field? or maybe there is another way to do it in Architect? (without data action)
{"filter": {"type": "and","predicates": [{"dimension": "queueId", "value": "${input.QUEUE_ID}"}] },"metrics": ["oUserPresences"]}
{"translationMap": {"on_queue_agents": "$.results[0].data[?(@.qualifier != 'OFFLINE')].stats.count"},"translationMapDefaults": {},"successTemplate": "{\"on_queue_agents\": \"${successTemplateUtils.firstFromArray(\"${on_queue_agents}\",\"0\")}\" }"}
Thanks,
Omri
------------------------------
OMRI ZVIELI
TSG IT Advanced Systems Ltd
Original Message:
Sent: 02-14-2022 10:23
From: Patrick Rohlf
Subject: In-Queue Agent Count
Omri,
I chose to build the solution this way, because I can use it to determine if there are any On Queue Users at all, while also getting additional information that I might wish to use for other decisions in the future.
If I'm reading your original intent correctly, the sample that I shared should be able to give you everything that you need already. Meaning: If there are '0' agents in the Idle status AND '0' agents in the Interacting status, then you can assume that there are '0' On Queue Users. The sample that I shared with you, exactly as it was shared, should generate no error when there '0' users on queue. At least that's been my experience with it. ;)
I hope that helps. Good luck!
{ "name": "(PROD) POST-OnQueueUsers-RoutingStatus [2022-02-08] - Exported 2022-02-13 @ 16:49", "integrationType": "purecloud-data-actions", "actionType": "custom", "config": { "request": { "requestUrlTemplate": "/api/v2/analytics/queues/observations/query", "requestType": "POST", "headers": { "Content-Type": "application/json" }, "requestTemplate": "{\n \"filter\": {\n \"type\": \"and\",\n \"predicates\": [\n {\n \"type\": \"dimension\",\n \"dimension\": \"queueId\",\n \"operator\": \"matches\",\n \"value\": \"${input.QUEUE_ID}\"\n }\n ]\n },\n \"metrics\": [\n \"oOnQueueUsers\"\n ]\n}" }, "response": { "translationMap": { "Users_IDLE_Array": "$.results[0].data[?(@.qualifier == 'IDLE')].stats.count", "Users_INTERACTING_Array": "$.results[0].data[?(@.qualifier == 'INTERACTING')].stats.count" }, "translationMapDefaults": { "Users_IDLE_Array": "[]", "Users_INTERACTING_Array": "[]" }, "successTemplate": "{\"Users_IDLE\": ${successTemplateUtils.firstFromArray(\"${Users_IDLE_Array}\",\"0\")},\"Users_INTERACTING\": ${successTemplateUtils.firstFromArray(\"${Users_INTERACTING_Array}\",\"0\")}}" } }, "contract": { "input": { "inputSchema": { "type": "object", "properties": { "QUEUE_ID": { "type": "string" } }, "additionalProperties": true } }, "output": { "successSchema": { "title": "oOnQueueUsers", "type": "object", "properties": { "Users_IDLE": { "type": "integer" }, "Users_INTERACTING": { "type": "integer" } }, "additionalProperties": true } } }, "secure": false}
------------------------------
Patrick Rohlf
Summit Broadband
Original Message:
Sent: 02-13-2022 17:59
From: OMRI ZVIELI
Subject: In-Queue Agent Count
So I changed the Request Body Template from "oOnQueueUsers" to "oUserRoutingStatuses" and it's working fine,
{"filter": {"type": "and","predicates": [{"dimension": "queueId", "value": "${input.QUEUE_ID}"}] },"metrics": ["oOnQueueUsers"]}
Now I get the count of Idle On Queue agents.
The only error I noticed is If there is no member configure on the Queue.
------------------------------
OMRI ZVIELI
TSG IT Advanced Systems Ltd
Original Message:
Sent: 02-13-2022 14:23
From: OMRI ZVIELI
Subject: In-Queue Agent Count
Hi Vaun,
Still getting an error:
Failed while processing the translation map. Could not resolve value for the key: 'on_queue_agents' and no default value was configured. Additional details: Missing property in path $['results'][0]['data']
JSON
{ "message": "Failed while processing the translation map. Could not resolve value for the key: 'on_queue_agents' and no default value was configured. Additional details: Missing property in path $['results'][0]['data']", "code": "bad.request", "status": 400, "messageParams": {}, "contextId": "6e37b90e-8697-42b0-bc53-3dd8ed63b385", "details": [ { "errorCode": "ACTION.PROCESSING" } ], "errors": []}
Thanks!
Omri
------------------------------
OMRI ZVIELI
TSG IT Advanced Systems Ltd
Original Message:
Sent: 02-13-2022 14:14
From: Vaun McCarthy
Subject: In-Queue Agent Count
HI Omri
Try this for your successTemplate line:
"successTemplate": "{\"on_queue_agents\": \"${successTemplateUtils.firstFromArray(\"${on_queue_agents}\",\"0\")}\" }"
------------------------------
Vaun McCarthy
Original Message:
Sent: 02-13-2022 13:49
From: OMRI ZVIELI
Subject: In-Queue Agent Count
Hi Patrick,
Did you manage to edit the Response when there is no agent On Queue,
I'm getting an error. Any ideas?
{
"translationMap": {
"on_queue_agents": "$.results[0].data[?(@.qualifier == 'IDLE')].stats.count"
},
"translationMapDefaults": {},
"successTemplate": "{\"on_queue_agents\": \"${successTemplateUtils.firstFromArray(\"${on_queue_agents}\")}\" }"
}
Thanks,
Omri
------------------------------
OMRI ZVIELI
TSG IT Advanced Systems Ltd
Original Message:
Sent: 01-31-2022 11:19
From: Patrick Rohlf
Subject: In-Queue Agent Count
Hello. I'm not sure if you we able to find a solution for this or not, but I was able to get my Action working with the details in this helpful post by @Craig Stevenson... RE: Inbound IVR - No agents on queue (JSON)
It has a .txt file attachment that contains all of the JSON pieces needed to configure the components in the Action.
------------------------------
Patrick Rohlf
Summit Broadband
Original Message:
Sent: 07-29-2020 12:59
From: Pooja Kumari
Subject: In-Queue Agent Count
Hi Kevin,
Can i get response and request contract for "/api/v2/analytics/queues/observations/query",
I tried this i am getting error
------------------------------
Pooja Kumari
Original Message:
Sent: 05-22-2019 18:49
From: Kevin Qi
Subject: In-Queue Agent Count
Hello @Charaf Eddine Chemlal,
We created a custom PC data action and use it in the call call flow, an example below:
{
"requestUrlTemplate": "/api/v2/analytics/queues/observations/query",
"requestType": "POST",
"headers": {
"UserAgent": "PureCloudIntegrations/1.0",
"content-type": "application/json"
},
"requestTemplate": "{\n \"filter\": {\n \"type\": \"or\",\n \"clauses\": [\n {\n \"type\": \"or\",\n \"predicates\": [\n {\n \"type\": \"dimension\",\n \"dimension\": \"queueId\",\n \"operator\": \"matches\",\n \"value\": \"xxxxxxx5f8-e715-45f1-91d7-11xxxxxxxxx\"\n }\n ]\n }\n ]\n },\n \"metrics\": [\n \"oOnQueueUsers\"\n ]\n}"
}
{
"translationMap": {
"oOnQueueUsers": "$.results[0].data[0].stats.count"
},
"translationMapDefaults": {},
"successTemplate": "{\"oOnQueueUsers\":${oOnQueueUsers}}"
}
Hope this helps.
Regards,
Kevin
------------------------------
Kevin Qi
CVT (Global) Pty Ltd
Original Message:
Sent: 05-22-2019 16:33
From: Charaf Eddine Chemlal
Subject: In-Queue Agent Count
Could you explain to me how did you create the custom data action using that API.
Appreciate your help @Kevin Qi
------------------------------
Charaf Eddine Chemlal
Dimension Data France
Original Message:
Sent: 04-26-2018 18:58
From: Kevin Qi
Subject: In-Queue Agent Count
Hi Jeff,
This API may help /api/v2/analytics/queues/observations/query, if you build a custom data action using this API, it can return "oOnQueueUsers", "oInteracting" etc. ie: number of agents logged in, interacting etc. We were able to plug this into the Architect and check the number of agents on queue. More details here https://developer.mypurecloud.com/api/rest/v2/analytics/.
Regards,
Kevin
------------------------------
Kevin Qi
CVT (Global) Pty Ltd
------------------------------
------------------------------
Kevin Qi
CVT (Global) Pty Ltd
Original Message:
Sent: 04-18-2018 11:15
From: Jeff Buzhardt
Subject: In-Queue Agent Count
I want to know how to tell in Architect whether there are any active agents.
I do not care if they are on the phone, just if they could potentially answer a call.
------------------------------
Jeff Buzhardt
MicroAutomation, Inc.
------------------------------