Escalate urgent tickets nobody has answered
Post to #support in Slack when an urgent ticket in your MySQL support desk has no first response. Spam excluded, one alert per ticket. SQL included.
- MySQL
- Slack
- Support
- once per ticket
The trigger
One read-only SELECT against MySQL. Rowfire polls it for new rows, and the rule fires once per ticket.
SELECT t.id,
t.subject,
t.requester_email,
t.channel,
t.created_at
FROM tickets t
WHERE t.priority = 'urgent'
AND t.first_response_at IS NULL
AND t.is_spam = 0This trigger reads a second data source: the support desk’s MySQL, not the application’s PostgreSQL. In Rowfire that’s one setting on the trigger.
The clock is created_at and the key is the ticket id. The rule
escalate_unanswered_urgent fires once per ticket and posts to
#support, for example:
Urgent ticket with no reply: {{ subject }} from {{ requester_email }} via {{ channel }}.
On the demo’s sample data, the backtest finds 7 over 120 days. When new
activity is simulated, two of three urgent tickets reach #support. The
third is marked as spam, so the query never returns it.
Questions
Our support desk is in MySQL and the app is in PostgreSQL. Does that matter?
No. Each trigger names the database it reads, and its query is checked and run in that database's own dialect.
Will it alert again after someone replies?
No. Once first_response_at is set the row no longer matches, and the rule fires once per ticket in any case.