The CreatorCon Call for Content is officially open! Get started here.

PATCH API

Shabbir1
Tera Contributor

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:


https://dev127677.service-now.com/api/now/table/incident/f70289b187ffad5093e30d490cbb359a?sysparm_fi...

 

JSON

{
"comments""TEST"
  }
 
Shabbir1_0-1688539593626.png

 

4 REPLIES 4

Abhay Kumar1
Giga Sage

@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.

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??

@Shabbir1 then you should have to have import set with proper transform map to achieve this.

Gurpreet07
Mega Sage

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.