From 4e15a2404f46f9538cdcb4aeb6a5b2169ef990d6 Mon Sep 17 00:00:00 2001 From: Austin Miller Date: Thu, 12 Mar 2026 16:29:13 -0700 Subject: [PATCH] Fix the mattermost created at timestamp --- app/models/pager_tree/integrations/channel/mattermost/v3.rb | 4 ++++ app/models/pager_tree/integrations/channel/slack/v3.rb | 6 +++++- .../pager_tree/integrations/channel/mattermost/v3_test.rb | 2 +- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/app/models/pager_tree/integrations/channel/mattermost/v3.rb b/app/models/pager_tree/integrations/channel/mattermost/v3.rb index 847a279..d8c6756 100644 --- a/app/models/pager_tree/integrations/channel/mattermost/v3.rb +++ b/app/models/pager_tree/integrations/channel/mattermost/v3.rb @@ -2,5 +2,9 @@ module PagerTree::Integrations class Channel::Mattermost::V3 < Channel::Slack::V3 # we can just piggy back the Channel::Slack::V3 since Mattermost is a clone of Slack # both integrations have the same exact functionality + + def _alert_created_at_timestamp_formatted + _alert.created_at.utc.iso8601.to_s + end end end diff --git a/app/models/pager_tree/integrations/channel/slack/v3.rb b/app/models/pager_tree/integrations/channel/slack/v3.rb index a859c0e..1286223 100644 --- a/app/models/pager_tree/integrations/channel/slack/v3.rb +++ b/app/models/pager_tree/integrations/channel/slack/v3.rb @@ -68,6 +68,10 @@ def adapter_process_outgoing outgoing_webhook_delivery end + def _alert_created_at_timestamp_formatted + "" + end + private def _alert @@ -99,7 +103,7 @@ def _blocks }, { title: "Created", - value: "", + value: _alert_created_at_timestamp_formatted, short: "true" }, { diff --git a/test/models/pager_tree/integrations/channel/mattermost/v3_test.rb b/test/models/pager_tree/integrations/channel/mattermost/v3_test.rb index 44b3391..0e6f782 100644 --- a/test/models/pager_tree/integrations/channel/mattermost/v3_test.rb +++ b/test/models/pager_tree/integrations/channel/mattermost/v3_test.rb @@ -83,7 +83,7 @@ class Channel::Mattermost::V3Test < ActiveSupport::TestCase }, { title: "Created", - value: "", + value: @alert.created_at.utc.iso8601.to_s, short: "true" }, {