Blythewarrior | 2024-12-12 16:53:59 UTC | #1
HI I've created an action to return oWaiting for multiple queues, but can not for the life of me work out how to get an output of the combined total. { "filter": { "type": "and", "clauses": [ { "type": "or", "predicates": [ { "type": "dimension", "dimension": "queueId", "operator": "matches", "value": "004f5dc6-dea5-4dcd-80c4-e25363548cc8" }, { "type": "dimension", "dimension": "queueId", "operator": "matches", "value": "20e0ff93-6c74-49e5-b2b8-43a440d559fc" }, { "type": "dimension", "dimension": "queueId", "operator": "matches", "value": "cdce0e37-8db2-450d-a05e-ef67a9cf990c" } ] }, { "type": "and", "predicates": [ { "type": "dimension", "dimension": "mediaType", "operator": "matches", "value": "voice" } ] } ] }, "metrics": [ "oWaiting" ] }
{ "translationMap": { "callsWaitingInQueue": "$.results[:-1].data[?(@.metric==\"oWaiting\")].stats.count"
}, "translationMapDefaults": { "callsWaitingInQueue": "[0]" }, "successTemplate": "{\"CALLSWAITINGINQUEUE\": ${successTemplateUtils.firstFromArray(\"${callsWaitingInQueue}\",\"0\")} }
Any help greatly appreciated
Jerome.Saint-Marc | 2024-12-13 09:20:56 UTC | #2
Hello,
You could use the following Response Configuration:
{
"translationMap": {
"callsWaitingArrayAsStr": "$.results[*].data[?(@.metric==\"oWaiting\")].stats.count"
},
"translationMapDefaults": {
"callsWaitingArrayAsStr": "[0]"
},
"successTemplate": "#set ($callsWaitingArray = $callsWaitingArrayAsStr.replace(\"[\", \"\").replace(\"]\", \"\").replace(\" \", \"\").split(\",\")) {\"CALLSWAITINGINQUEUE\":$math.getTotal(${callsWaitingArray}) }"
}
This was for a different API Endpoint but the logic is explained in this older post.
Regards,
Blythewarrior | 2024-12-13 09:55:18 UTC | #3
Thanks Jerome Unfortunately that returns a zero even when I've got calls queueing
Jerome.Saint-Marc | 2024-12-13 10:30:26 UTC | #4
It appears to work for me.
I assumed you were using a POST /api/v2/analytics/queues/observations/query in a Genesys Cloud Data Action.
What do you see when you test your Genesys Cloud Data Action in the UI, at Operations' step "*8. Execute*"? Do you see the current call count reflected in the queue's stats.count? If not (all 0 or not listed), it could be that the Genesys Cloud OAuth Client (Client Credentials Grant) that your Genesys Cloud Data Actions integration leverages is missing permissions or visibility on the proper divisions (to which the Queues belong to).
Regards,
Blythewarrior | 2024-12-13 11:33:35 UTC | #5
Jerome.Saint-Marc, post:4, topic:30835
If not (all 0 or not listed),
Thanks again, I am using that action and get {} in the execute step.
The OAUTH has analytics All permission for all divisions
Thanks Phil
Blythewarrior | 2024-12-13 13:40:21 UTC | #6
Ignore me please. I'd messed around that much yesterday that my request was wrong!!
Working perfectly now, thank you
system | 2025-01-13 13:41:00 UTC | #7
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.
This post was migrated from the old Developer Forum.
ref: 30835