I have a observation query action, and I want to get a total amount for two different results, how do I achive this?
{
"translationMap": {
"queueLengthVoice": "$.results[?(@.group.mediaType==\"voice\")].data[?(@.metric==\"oWaiting\")].stats.count",
"queueLengthCallback": "$.results[?(@.group.mediaType==\"callback\")].data[?(@.metric==\"oWaiting\")].stats.count",
"agentsOnQueueInteracting": "$.results[?(@.group.queueId)].data[?(@.metric==\"oOnQueueUsers\"&&@.qualifier==\"INTERACTING\")].stats.count",
"agentsOnQueueIdle": "$.results[?(@.group.queueId)].data[?(@.metric==\"oOnQueueUsers\"&&@.qualifier==\"IDLE\")].stats.count",
"totalQueue": ??
},
"translationMapDefaults": {},
"successTemplate": "{
\"agentsOnQueueIdle\": ${successTemplateUtils.firstFromArray(\"${agentsOnQueueIdle}\", \"0\")},
\"agentsOnQueueInteracting\": ${successTemplateUtils.firstFromArray(\"${agentsOnQueueInteracting}\", \"0\")},
\"queueLengthVoice\": ${successTemplateUtils.firstFromArray(\"${queueLengthVoice}\", \"0\")},
\"queueLengthCallback\": ${successTemplateUtils.firstFromArray(\"${queueLengthCallback}\", \"0\")},
\"TotalQueue\": ${successTemplateUtils.firstFromArray(\"${totalQueue}\", \"0\")}}"
}
If you look at the translationMap, I want the values for "queueLenghtVoice" and "queueLenghtCallback" to be added together in the value "totalQueue".
Ive tried different ways, but I couldn't figure out using Velocity macros with the math prefix how to achive this. Appreciate all insights you could share, thanks.