PATCH API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2023 11:31 PM - edited 07-04-2023 11:46 PM
Hi
Need PATCH API to update comments filed in incident tried this below API its working fine with sys_id of the incident but I want to update incident with incident number can anyone help me how to achieve this
PATCH API:
JSON
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2023 12:11 AM
@Shabbir1 Try post method with correlation Id, as what I am aware correlation id is a field which is used to verify whether it's new one or existing to be updated .
Hope this will help you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2023 12:36 AM
we are updating already created incident ..so it comes under PATCH correct..?? i want to update comments field .with sys_id its working as i shown above but we need to update by using incident number ..in REST API explorer sys_id is showing mandatory... how to achieve this..by using incident number??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2023 02:46 AM
@Shabbir1 then you should have to have import set with proper transform map to achieve this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-05-2023 12:41 AM
Update api works only with sys_id. To accomplish this kind of task, you first need to use get method to get the sys_id against the incident number and then use patch / put method to update the record using sys id.
Get Api:
https://dev127677.service-now.com/api/now/table/incident?sysparm_limit=1&sysparm_query=number=INC0015832'
Above will provide you with all details of the record from which you need to get sys_id and use that in patch api.