Mostafa_OUDDERHEM | 2020-12-21 10:09:58 UTC | #1
Hi,
I have create a custom data action to calculate the number of waiting calls type voice on an existing queue in realtime. The raw result, is returning the correct values:
{ "results.group.mediaType": [ "chat", "message", "email", "voice", "callback" ], "results.data.metric": [ [ "oWaiting" ], [ "oWaiting" ], [ "oWaiting" ], [ "oWaiting" ], [ "oWaiting" ] ], "results.data.stats.count": [ [ 0 ], [ 0 ], [ 0 ], [ 0 ], [ 0 ] ], "results.group.queueId": [ "0d981fc7-b9c0-4e94-a59b-689a1d8e551e", "0d981fc7-b9c0-4e94-a59b-689a1d8e551e", "0d981fc7-b9c0-4e94-a59b-689a1d8e551e", "0d981fc7-b9c0-4e94-a59b-689a1d8e551e", "0d981fc7-b9c0-4e94-a59b-689a1d8e551e" ] }
However I want to show this result on the output field called "NbWaitingCalls" in order to use it in Architect to make decision. On the translationMap I have tried: $.results.group.mediaType:["voice"].data.metric:["oWaiting"].data.stats.count but not working, any help please ? Thank you.
Armands_Bunkovskis | 2020-12-21 15:32:49 UTC | #2
Hi! I would do a follwing request, which returns single media answer: { "filter": { "type": "and", "predicates": [ { "type": "dimension", "dimension": "queueId", "operator": "matches", "value": "0d981fc7-b9c0-4e94-a59b-689a1d8e551e" }, { "type": "dimension", "dimension": "mediaType", "operator": "matches", "value": "voice" } ] }, "metrics": [ "oWaiting" ] }
The result will look like this: { "results": [ { "group": { "queueId": "0d981fc7-b9c0-4e94-a59b-689a1d8e551e", "mediaType": "voice" }, "data": [ { "metric": "oWaiting", "stats": { "count": 0 } } ] } ] }
Then you can get an actual value with JSON path: $.results..count
Mostafa_OUDDERHEM | 2020-12-22 07:51:00 UTC | #3
Hi,
It works fine, thank you. I change it also to return the number of waiting callback.
system | 2021-01-22 07:51:01 UTC | #4
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: 9561