diff --git a/apps/trigger/env.d.ts b/apps/trigger/env.d.ts index 4ca1a56bf..1d27e4256 100644 --- a/apps/trigger/env.d.ts +++ b/apps/trigger/env.d.ts @@ -7,6 +7,8 @@ declare global { ENVIRONMENT: string; NODE_ENV?: 'development' | 'production' | 'test'; BUSTER_URL: string; + BUSTER_ALERT_CHANNEL_TOKEN?: string; + BUSTER_ALERT_CHANNEL_ID?: string; } } } diff --git a/apps/trigger/src/tasks/message-post-processing/helpers/slack-notifier.ts b/apps/trigger/src/tasks/message-post-processing/helpers/slack-notifier.ts index 269aaf1b2..d01d74e79 100644 --- a/apps/trigger/src/tasks/message-post-processing/helpers/slack-notifier.ts +++ b/apps/trigger/src/tasks/message-post-processing/helpers/slack-notifier.ts @@ -211,6 +211,24 @@ export async function sendSlackNotification( slackMessage ); + const busterChannelToken = process.env.BUSTER_ALERT_CHANNEL_TOKEN; + const busterChannelId = process.env.BUSTER_ALERT_CHANNEL_ID; + + //Step 6: Send Alert To Buster Channel + if (busterChannelToken && busterChannelId) { + const busterResult = await sendSlackMessage( + busterChannelToken, + busterChannelId, + slackMessage + ); + if (!busterResult.success) { + logger.warn('Failed to send alert to Buster channel', { + error: busterResult.error, + channelId: busterChannelId, + }); + } + } + if (result.success) { logger.log('Successfully sent Slack notification', { organizationId: params.organizationId,