From b66d38e7dfdf5b55cf1e50def697ffd04002a060 Mon Sep 17 00:00:00 2001 From: Marko Simon Date: Tue, 1 Oct 2024 19:32:58 +0200 Subject: [PATCH 1/3] fix incorrectly using api version 1 in edge cases --- alert_action.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alert_action.go b/alert_action.go index a415b47..d3d6f5f 100644 --- a/alert_action.go +++ b/alert_action.go @@ -395,7 +395,7 @@ func (c *Client) CreateAlertAction(input *CreateAlertActionInput) (*CreateAlertA if input.AlertAction == nil { return nil, errors.New("alert action input is required") } - if input.AlertAction.AlertSources != nil && len(*input.AlertAction.AlertSources) == 1 && (input.AlertAction.Teams == nil || len(*input.AlertAction.Teams) == 0) { + if input.AlertAction.AlertSources != nil && len(*input.AlertAction.AlertSources) == 1 && (input.AlertAction.Teams == nil || len(*input.AlertAction.Teams) == 0) && input.AlertAction.Conditions == "" { sourceId := (*input.AlertAction.AlertSources)[0].ID // manually set fields to ensure backwards compatibility with api v1 @@ -576,7 +576,7 @@ func (c *Client) UpdateAlertAction(input *UpdateAlertActionInput) (*UpdateAlertA if input.AlertActionID == nil { return nil, errors.New("alert action id is required") } - if input.AlertAction.AlertSources != nil && len(*input.AlertAction.AlertSources) == 1 && (input.AlertAction.Teams == nil || len(*input.AlertAction.Teams) == 0) { + if input.AlertAction.AlertSources != nil && len(*input.AlertAction.AlertSources) == 1 && (input.AlertAction.Teams == nil || len(*input.AlertAction.Teams) == 0) && input.AlertAction.Conditions == "" { sourceId := (*input.AlertAction.AlertSources)[0].ID // manually set fields to ensure backwards compatibility with api v1 From 2b6fddf0d70bc5c26d5583f0b17823bbc5b8f3b9 Mon Sep 17 00:00:00 2001 From: Marko Simon Date: Tue, 1 Oct 2024 19:33:10 +0200 Subject: [PATCH 2/3] version bump --- version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/version.go b/version.go index a74a6c7..df716f7 100644 --- a/version.go +++ b/version.go @@ -1,4 +1,4 @@ package ilert // Version package version -const Version = "v3.10.0" +const Version = "v3.10.1" From a635e634f75eeb8d08ab4e0c7e56420450a3c838 Mon Sep 17 00:00:00 2001 From: Marko Simon Date: Tue, 1 Oct 2024 19:34:25 +0200 Subject: [PATCH 3/3] update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c93a777..1ce82a4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 01.10.2024, Version 3.10.1 + +- fix to ensure backwards compatibility when using conditions field [#46](https://github.com/iLert/ilert-go/pull/46) + ## 01.10.2024, Version 3.10.0 - add conditions field to alert action [#45](https://github.com/iLert/ilert-go/pull/45)