We can create new incident record through post method rest api explorer.But i want to insert field vaues to new incident through json body rest client browser extension ?

rmaheshg80
Kilo Contributor

We can create new incident record through post method rest api explorer.But i want to insert field vaues to new incident through json body rest client browser   extension ?

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Mahesh,



So you know how to insert new record in incident. Now you want to update few field values in the incident record correct.


So use the PUT method from rest api explorer and give the json body.



Table API - PUT /now/table/{tableName}/{sys_id}


https://developer.servicenow.com/app.do#!/rest_api_doc?v=jakarta&id=r_TableAPI-PUT



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


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

Hi Ankur,



Thanks for quick response.



We should not use Rest API Explorer from Servicenow. We should use only RestClient extension from browser, which is 3rd party application.



I am going try to create an Incident records using REST Client add-on extension from Mozilla browser. I added the same



1. I gave the basic authentication details


2. Provided URL like : https://*******.service-now.com/incident.do


3. Method : Post (To create incident records, whenever send the request in Webclient extension)


4. Header details : application/json



so next I have to write script in JSon body


"Short Description" : "Test", "Impact" :"2", "Urgency" : "2",values should be updated along with new incident. So please advise me ?


Could you please provide the some sample Json script to update above   (Short Description, Impact, Urgency) in new incident ?


Hi Mahesh,



Following links should be helpful:


Inbound REST Scripted Web Service


Scripted Rest API "PUT" method application.


Scripted Rest API - GET



Mark Correct if this solves your issue and also hit Like and Helpful if you find my response worthy based on the impact.


Thanks


Ankur


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

Hi Raja,



Any update on this?


Can you mark my answer as correct, helpful and hit like 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