Trying to wire up a webhook that triggers on queue SLA breaches and sends a formatted message to Slack. The Genesys Cloud event payload is nested pretty deep, so I’m struggling with the JSON mapping to get the queue name and current wait time into the Slack blocks array. Is there a specific expression syntax I need to use in the webhook config to flatten that data, or do I have to write a middle-tier lambda to handle the transformation?
You don’t need a lambda. The webhook JSON builder handles nested objects fine. You just need to map the fields correctly in the Slack blocks payload.
Here’s the structure. Note the {{}} syntax for dynamic values.
{
"channel": "#alerts",
"blocks": [
{
"type": "header",
"text": {
"type": "plain_text",
"text": "SLA Breach: {{queue.name}}"
}
},
{
"type": "section",
"fields": [
{
"type": "mrkdwn",
"text": "*Queue:*\n{{queue.name}}"
},
{
"type": "mrkdwn",
"text": "*Wait Time:*\n{{statistic.waitTime}}s"
}
]
}
]
}
The event payload for routing.queue.conversation.waittime puts the queue details in the queue object and the metric in statistic. If statistic.waitTime comes back as null, check your event subscription filter. It might be firing before the wait time is populated.
Also, Slack requires the channel field in the top-level payload if you’re using a bot token. If you’re using a webhook URL, drop the channel field and target the channel in the URL itself.