Könnte man das Subselect noch um eine WHERE Clause erweitern, so das mir lediglich die Kategorie mit dem Value “B-B-Anfrage” angezeigt wird?
SELECT queue_timestamp,
from_number,
from_name,
status,
queue_name,
agent_name,
agent_number,
total_duration,
moh_duration,
agent_ringing,
talking_duration,
hold_duration,
chain,
(SELECT string_agg("displayName" || ': ' || "value",', ') as labels
FROM jsonb_to_recordset(data->'labels') AS result("displayName" text, "value" text))
FROM filter_queue_calls($__timeFrom(), $__timeTo(),'${team:csv}','${user:csv}','$fromName','$fromNumber','${label:csv}')
ORDER by queue_timestamp DESC;
Beispiel eines Labels:
{
"queue": {
"queueName": "Team-MG",
"joinPosition": 1,
"ringedAgents": 4,
"joinQueueState": {
"countEntries": "1",
"countMembersBusy": "0",
"countActiveMembers": "4",
"countPausedMembers": "0",
"countMembersRinging": "0",
"countInactiveMembers": "6",
"countMembersNotInUse": "4",
"countMembersUnavailable": "0",
"countMembersPerPauseReason": {}
},
"queueExtension": "1160"
},
"labels": [
{
"id": 2,
"type": "generic",
"value": "intern",
"visible": true,
"displayName": "Kategorie"
},
{
"id": 1,
"type": "generic",
"value": "95",
"visible": false,
"displayName": "Priorität"
},
{
"id": 3,
"type": "generic",
"value": "1000",
"visible": true,
"displayName": "Quelle"
},
{
"id": 2,
"type": "generic",
"value": "B-B-Anfrage",
"visible": true,
"displayName": "Kategorie"
}
]
}
Wäre nett, wenn Ihr mir hier noch einen Hinweis geben könntet.
VG Jens