From f2f4cd3ce464d110b4143e92295e83a6577bd27d Mon Sep 17 00:00:00 2001 From: Pavel Zavora Date: Wed, 9 Jun 2021 06:12:45 +0200 Subject: [PATCH] fix(teams): revert ChannelURL mapping to preserve backward compatibility with saved TICKscripts --- pipeline/alert.go | 2 +- server/server_test.go | 2 +- services/teams/service.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/pipeline/alert.go b/pipeline/alert.go index 48dffaf60..ca21ea504 100644 --- a/pipeline/alert.go +++ b/pipeline/alert.go @@ -2248,7 +2248,7 @@ type TeamsHandler struct { // Teams channel webhook URL to post messages. // If empty uses the URL from the configuration. - ChannelURL string `json:"channel-url"` + ChannelURL string `json:"channel_url"` } // Send the alert to ServiceNow. diff --git a/server/server_test.go b/server/server_test.go index da1fcec51..aa5b751e9 100644 --- a/server/server_test.go +++ b/server/server_test.go @@ -9457,7 +9457,7 @@ func TestServer_ListServiceTests(t *testing.T) { Link: client.Link{Relation: client.Self, Href: "/kapacitor/v1/service-tests/teams"}, Name: "teams", Options: client.ServiceTestOptions{ - "channel-url": "", + "channel_url": "", "alert_topic": "test kapacitor alert topic", "alert_id": "foo/bar/bat", "message": "test teams message", diff --git a/services/teams/service.go b/services/teams/service.go index d766b9507..eac085341 100644 --- a/services/teams/service.go +++ b/services/teams/service.go @@ -70,7 +70,7 @@ func (s *Service) StateChangesOnly() bool { } type testOptions struct { - ChannelURL string `json:"channel-url"` + ChannelURL string `json:"channel_url"` AlertTopic string `json:"alert_topic"` AlertID string `json:"alert_id"` Message string `json:"message"`