Hey everyone,
I’m trying to set up a webhook that triggers a Slack notification whenever a specific queue breaches its SLA. I’ve got the webhook configured in Genesys Cloud to point to our Slack incoming webhook URL, but the message formatting is a total mess. Slack expects a specific JSON structure for the text or blocks field, but Genesys is sending the raw event payload.
Here is the JSON payload I’m seeing in the webhook test log:
{
"event": {
"id": "evt-12345",
"type": "queue.sla.breach",
"data": {
"queueId": "queue-abc",
"queueName": "Support Tier 1",
"currentSLA": 0.85,
"targetSLA": 0.95
}
},
"timestamp": "2023-10-27T14:30:00Z"
}
I tried adding a transformation step using the POST body override, but I can’t seem to get the syntax right for mapping the data.queueName into a Slack-compatible format. I need the final JSON sent to Slack to look something like this:
{
"text": "ALERT: Queue *Support Tier 1* has breached SLA. Current: 85%, Target: 95%"
}
Is there a way to use a simple template engine or a script within the webhook configuration to reshape this? Or do I need to spin up a tiny Node.js endpoint in between to do the transformation? I’d prefer to keep it native if possible.
I’ve checked the API docs for webhooks, but the transformation examples are pretty sparse. I don’t want to maintain a separate service just for this notification if I can avoid it. Any pointers on how to structure the request body or if there’s a hidden feature for payload mapping I’m missing?