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

fix creating services that don't use support hours #255

Merged
merged 1 commit into from Jan 7, 2021
Merged

fix creating services that don't use support hours #255

merged 1 commit into from Jan 7, 2021

Conversation

cluarkhpe
Copy link
Contributor

It appears that when creating a service with scheduled_actions: null, the API requires that support_hours is also set to null.
Without this change the API returns an error: HTTP response code: 400. Error: &{2001 Invalid Input Provided [Support hours is required.]}

@stmcallister
Copy link
Contributor

Hello! Can you share more context of the scenario you're describing? I'm unable to reproduce the behavior on the API. When I remove scheduled_actions by setting it to null as you described I'm still able to create a service with support_hours set.

@GiedriusS
Copy link
Contributor

GiedriusS commented Dec 18, 2020

Heh, created a PR for the same issue: #258. @stmcallister I think you got this wrong - we are talking about support_hours here. We don't want to set any value for it or IOW we want to use whatever the defaults are. Having omitempty means that if the PTR is nil then it does not end up in the JSON that we send over the wire. And the API rejects requests where this key does not exist - it must be either set to null explicitly or set to the actual value. PTAL again when you'll have some time.

@stmcallister
Copy link
Contributor

@GiedriusS Oh! I see what you're saying. I'll take another look.

@stmcallister
Copy link
Contributor

@cluarkhpe There's been a change made to service.go since you created this PR, causing a conflict. Will you resolve the conflict. Once it's resolved I'll merge your change.

@cluarkhpe
Copy link
Contributor Author

@stmcallister should be good now

Copy link
Contributor

@stmcallister stmcallister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thank you for doing this 🎉 👍

@stmcallister stmcallister merged commit eab6a10 into PagerDuty:master Jan 7, 2021
@cluarkhpe cluarkhpe deleted the fix-services branch January 7, 2021 17:48
@theckman theckman added this to the v1.4.0 milestone Mar 10, 2021
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 this pull request may close these issues.

None yet

4 participants