Skip to content

Commit

Permalink
Responder type escalation in alert policies
Browse files Browse the repository at this point in the history
This commit allows to set responder type `escalation` to alert policies.

Closes: opsgenie#118
  • Loading branch information
janhorstmann committed Dec 12, 2022
1 parent d0f3673 commit 5e00367
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions policy/request.go
Original file line number Diff line number Diff line change
Expand Up @@ -681,8 +681,8 @@ func ValidateDelayAction(action DelayAction) error {

func ValidateResponders(responders *[]alert.Responder) error {
for _, responder := range *responders {
if responder.Type != alert.UserResponder && responder.Type != alert.TeamResponder {
return errors.New("responder type for alert policy should be one of team or user")
if responder.Type != alert.UserResponder && responder.Type != alert.TeamResponder && responder.Type != alert.EscalationResponder {
return errors.New("responder type for alert policy should be one of team, user or escalation")
}
if responder.Id == "" {
return errors.New("responder id should be provided")
Expand Down

0 comments on commit 5e00367

Please sign in to comment.