Skip to content

Commit

Permalink
Use pointer to Priority so don't send and empty priority for incident
Browse files Browse the repository at this point in the history
Due to the changes to the Incident struct the library now inadvertently
sends an empty priority to the API (`"priority":{}`) and for
ManageIncidents this results in a response of:

    Priority id cannot be empty

To prevent sending an empty priority we can use a pointer to Priority.

Seems like a super simple fix for this - and as such I'm worried I've
missed something else.

Full discussion of this in this issue:

References: #135
  • Loading branch information
atomicules committed Aug 21, 2019
1 parent 768e5bc commit c115f77
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion incident.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ type Incident struct {
FirstTriggerLogEntry APIObject `json:"first_trigger_log_entry,omitempty"`
EscalationPolicy APIObject `json:"escalation_policy,omitempty"`
Teams []APIObject `json:"teams,omitempty"`
Priority Priority `json:"priority,omitempty"`
Priority *Priority `json:"priority,omitempty"`
Urgency string `json:"urgency,omitempty"`
Status string `json:"status,omitempty"`
Id string `json:"id,omitempty"`
Expand Down

0 comments on commit c115f77

Please sign in to comment.