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

Allow passing string-type target to Resource.update #169

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

rbw
Copy link
Owner

@rbw rbw commented Mar 6, 2021

Adds support for passing target as string:

updated = resource.update("1c741bd70b2322007518478d83673af3", {"short_description": "test"})
print(updated["short_description"])

Selection using a dict-type query or the QueryBuilder still works:

updated = resource.update({"number": "INC012345"}, {"short_description": "test"})
print(updated["short_description"])

This also changes the Resource.update() to use the PATCH method instead of PUT, as some ServiceNow APIs don't support PUT. These methods behave the same in ServiceNow nowadays, i.e. this should be a non-breaking change.

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.

Update a change request record using pysnow.response.Response update() fails.
1 participant