- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-07-2022 11:05 PM
Hi,
I have a system which only uses REST API to push data to ServiceNow. When the classification changes for a device (for example an OT device now is discovered to be a OT sensor), how should I update the record? PUT gives me a 404 if I try to PUT against the new table name with the same sys_id.
Is there a way to achieve the above without resorting to a DELETE and POST (create a new record in the new table)?
thanks,
Deepak
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2022 11:01 AM
I am checking the class with the "sys_class_name" attribute in the response as well. I just found out from another serviceNow expert that the {tableName} param should be target the highest common class between the input class and the replacement class in order to avoid the 404 error.
In my case, I was trying to move from "cmdb_ci_pc_hardware" to "cmdb_ci_server" - so when I set the {tableName} to "cmdb_ci_hardware", it worked!
Thanks for the pointers @RaghavSh . I am marking this as the solution
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2022 09:01 AM
Thanks @RaghavSh for trying it out. But I did not try it on an OOB instance. Do you know what is the minimum role the API user should have. I have admin and itil.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2022 09:09 AM
@dcherian i had admin role.
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2022 09:24 AM
Actually, don't you have to set the {tableName} param to the new table name in your REST endpoint?
I tried as your did against the old tableName. It did not actually change the class though it gave a 200 response. Please check the response body. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2022 09:30 AM
How are you checking the class, in my case the CI moves from computer class to window class.
The {tableName} param was old table name only.
Did you try in oob instance? Can you send the entire page screenshot?
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-08-2022 11:01 AM
I am checking the class with the "sys_class_name" attribute in the response as well. I just found out from another serviceNow expert that the {tableName} param should be target the highest common class between the input class and the replacement class in order to avoid the 404 error.
In my case, I was trying to move from "cmdb_ci_pc_hardware" to "cmdb_ci_server" - so when I set the {tableName} to "cmdb_ci_hardware", it worked!
Thanks for the pointers @RaghavSh . I am marking this as the solution