diff --git a/app/models/pager_tree/integrations/datadog/v3.rb b/app/models/pager_tree/integrations/datadog/v3.rb index 4cc7d5e..3609109 100644 --- a/app/models/pager_tree/integrations/datadog/v3.rb +++ b/app/models/pager_tree/integrations/datadog/v3.rb @@ -1,9 +1,12 @@ module PagerTree::Integrations class Datadog::V3 < Integration - OPTIONS = [] + OPTIONS = [ + {key: :support_retriggered_event, type: :boolean, default: false} + ] store_accessor :options, *OPTIONS.map { |x| x[:key] }.map(&:to_s), prefix: "option" after_initialize do + self.option_support_retriggered_event ||= false end def adapter_supports_incoming? @@ -24,8 +27,12 @@ def adapter_thirdparty_id def adapter_action case _transition - when "Triggered" then :create - when "Recovered" then :resolve + when "Triggered" + :create + when "Recovered" + :resolve + when "Re-Triggered" + self.option_support_retriggered_event == true ? :recreate : :other else :other end diff --git a/app/views/pager_tree/integrations/datadog/v3/_form_options.html.erb b/app/views/pager_tree/integrations/datadog/v3/_form_options.html.erb index e69de29..a9c8edb 100644 --- a/app/views/pager_tree/integrations/datadog/v3/_form_options.html.erb +++ b/app/views/pager_tree/integrations/datadog/v3/_form_options.html.erb @@ -0,0 +1,7 @@ +
<%== t(".option_support_retriggered_event_hint_html") %>
++ <%= render partial: "shared/components/badge_enabled", locals: { enabled: integration.option_support_retriggered_event } %> +
+