Ask questionsCannot define immediate notification in notification rule step

I want to define a notification rule step for a "New Alert" with no delay (so that I immediately receive the notification). The Opsgenie API documentation indicates that the sendAfter field must be specified for New Alert and Assigned Alert notification rules:

Time period (in minute) when notification will be sent after. Valid and Mandatory only for New Alert and Assigned Alert notification rules. sendAfter parameter should be given as an object which has a timeAmount field that takes amount as minutes.

Nevertheless, specifying 0 as TimeAmount won't work because the field would be omitted:

type SendAfter struct {
	TimeAmount uint32 `json:"timeAmount,omitempty"`
	TimeUnit   string `json:"timeUnit,omitempty"`

On the other hand, the API is perfectly happy to receive 0.

Would simply removing omitempty be a viable solution?


Answer questions jwebb

Any news on this? It's a one-line fix. (trabab's proposed workaround is not valid - cannot possibly compile - since TimeAmount is not a pointer.)


Related questions

No questions were found.
Github User Rank List