oncall
oncall copied to clipboard
Feat 549 - add telegram permalink to alert groups http response
This PR closes #549.
It does the following:
- renames/refactors the
AlertGroupmodel'spermalinkproperty toslack_permalink - adds a
telegramkey to thepermalinksobject in the alert group's public API HTTP response object
Tested locally

A question I had was whether it or it makes sense to return just one, or multiple telegram permalinks? As I understand an AlertGroup has a one-to-many relationship with a TelegramMessage.
A question I had was whether it or it makes sense to return just one, or multiple telegram permalinks? As I understand an
AlertGrouphas a one-to-many relationship with aTelegramMessage.
I would say we only want to show the main alert group message in the channel (not DMs). The query would be something like this:
alert_group.telegram_messages.filter(Q(chat_id__startswith="-") & Q(message_type=TelegramMessage.ALERT_GROUP_MESSAGE)).first()
If chat_id starts with "-" it means it's a channel message and not a DM.