Query on updating a incident record using REST message

varunkumar1
Tera Contributor

Hi Team,

 

I am doing servicenow - servicenow integration using REST table API. I am done with incident POST method and now working on  PUT method. when I am testing PUT operation using REST API Explorer using Table API, I selected table name as incident and mentioned the sys_id of the record to be updated. When I tested it is showing 200 OK. Now I am configuring PUT method in REST Outbound I have given the end point that I copied while testing in the REST API explorer

https://dev61095.service-now.com/api/now/table/incident/35d2e7a9db77130080789b81ca9619e7?sysparm_fields=sys_id%2Cnumber

And during testing from REST outbound, it is updating the record with sys_id that is present in the above URL. What am I suppose to do to overcome this problem. Even time when I test the PUT method, it is updating the same record of the sys_id 35d2e7a9db77130080789b81ca9619e7

I know that changing sys_id from the above URL will make corresponding record to get update. But I don't want to change URL manually every time in the PUT method in the REST message.

Please help me with the solution for this problem 

6 REPLIES 6

After you have added the Variable you need to start adding a value to it. If you click the "Preview Script Usage" you should see a new row which is how you set the variable.

 r.setStringParameterNoEscape('number', '');


Now if you want to do this in your test you can instead click "Auto-generate variables" which will populate the Related list called Variable Substitutions where you can just add a value for your variable

Hi Varun,

Any update on this?
Can you mark my answer as correct, helpful if you were able to achieve the requirement. This helps in removing this question from unanswered list and helps users to learn from your thread. Thanks in advance.

Regards
Ankur

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader