-
Notifications
You must be signed in to change notification settings - Fork 90
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
Update a change request record using pysnow.response.Response update() fails. #166
Comments
I think what is happening is,
Line 136 returns 2 values in the array - first one being the actual data and second one being the meta data
Hence self.get(query=query).one() results in the following exception.
Can anyone help me fixing this? |
I made the following changes to see if it works but got 405 with PUT request
Error as below
|
Taking a look shortly. |
As you pointed out, a metadata object is included in the response when fetching by ID in the Change Management API. Pysnow doesn't support this; it expects exactly one object in the response content when performing an update this way. I'll add support for passing sys_id directly Anyway, try this in the meantime: ...
resource = client.resource(base_path="/api", api_path="/sn_chg_rest/change/standard")
resource.request(
"PATCH",
path_append="<sys_id>",
json={"short_description": "hello"}
) |
I've created a PR to make it possible to update records in the sn_chg_rest API using standard methods: #169 Would appreciate it if you could test it out. And again, updating via a |
@ksanand have you had a chance to test this out? |
Sorry, I haven’t had a chance to test it yet. I will get to it sometime
this week.
Thanks,
Anand.
…On Sun, 21 Mar 2021 at 8:06 pm, Robert Wikman ***@***.***> wrote:
@ksanand <https://github.com/ksanand> have you had a chance to test this
out?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#166 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAUT6K62HCWGUVB2IKYW4KLTEWZITANCNFSM4WYIGHVA>
.
|
I am trying to update the description of a standard change request like shown below but getting error
return self._resource.update({"sys_id": self["sys_id"]}, payload)
The text was updated successfully, but these errors were encountered: