pysnow icon indicating copy to clipboard operation
pysnow copied to clipboard

Allow passing string-type target to Resource.update

Open rbw opened this issue 3 years ago • 0 comments

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.

rbw avatar Mar 06 '21 22:03 rbw