Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ManageIncidentsOptions doesn't take EscalationLevel #364

Closed
sim1s opened this issue Sep 15, 2021 · 2 comments · Fixed by #366
Closed

ManageIncidentsOptions doesn't take EscalationLevel #364

sim1s opened this issue Sep 15, 2021 · 2 comments · Fixed by #366
Milestone

Comments

@sim1s
Copy link
Contributor

sim1s commented Sep 15, 2021

While trying to use the go-pagerduty client to escalate an incident, I noticed that EscalationLevel is missing in ManageIncidentsOptions

go-pagerduty/incident.go

Lines 169 to 177 in 340f6d5

type ManageIncidentsOptions struct {
ID string `json:"id"`
Type string `json:"type"`
Status string `json:"status,omitempty"`
Priority *APIReference `json:"priority,omitempty"`
Assignments []Assignee `json:"assignments,omitempty"`
EscalationPolicy *APIReference `json:"escalation_policy,omitempty"`
Resolution string `json:"resolution,omitempty"`
}

The payload for the API allows for escalation_level

https://developer.pagerduty.com/api-reference/reference/REST/openapiv3.json/paths/~1incidents/put

@theckman
Copy link
Collaborator

@sim1s do you know whether that field uses zero-based indices? They don't show an example, so I'm not sure if the second escalation level is 1 or 2. Also, might you have the spare cycles to raise a PR to add this?

For some context, this library is largely community maintained, and while I can review and merge PRs contributed by others I cannot merge my own and must wait for a PD employee to have some time to review my changes.

If you had the time to raise the PR and address any feedback, it would make it so I could merge it in to eventually be released with v1.5.0.

@sim1s
Copy link
Contributor Author

sim1s commented Sep 27, 2021

@theckman the field does not use zero-based indices, the first escalation level is 1. The response also does not specify which escalation level is currently triggered, and sending a value of 0 or 1 brings the escalation down to the lowest level (first responders).

Here's a PR to resolve this

@theckman theckman added this to the v1.5.0 milestone Sep 28, 2021
@theckman theckman linked a pull request Nov 9, 2021 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants