Total calls Queueing Across Multiple Queues

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

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,

Thanks Jerome
Unfortunately that returns a zero even when I've got calls queueing

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,

Thanks again, I am using that action and get {} in the execute step.

The OAUTH has analytics All permission for all divisions

Thanks Phil

Ignore me please. I'd messed around that much yesterday that my request was wrong!!

Working perfectly now, thank you

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.