I get method not supported error when I try to use Rest API's Put and Patch methods for case table.

Chethan Kumar
Mega Contributor

I get error when I try to use Rest API's Put and Patch methods for case table. Could someone let me know how to update cases when there is trigger from external application? I want the script to read case Sys_ids dynamically.

1 ACCEPTED SOLUTION

Sounds like you need a scripted rest API, so you can take advantage of import set/transform map coalesce functionality based on sys_id Toney Vecchio has created an excellent presentation about Scripted Rest API's. https://community.servicenow.com/community?id=community_article&sys_id=d5c94462dbf557002328f3231f96197a and a video of his presentation https://www.youtube.com/watch?v=DyIuma1cZrg

View solution in original post

4 REPLIES 4

Tony Chatfield1
Kilo Patron

Hi, I have just tested Rest 'PUT' and 'PATCH' for OOB vanilla NewYork directly into table 'sn_customerservice_case' without any issues.

You might have to explain your statement "I want the script to read case Sys_ids dynamically" ?

If you do not identify a valid servicenow record sys_id (for the table you are making the put\patch to) in your rest transaction then ServiceNow cannot know which record it needs to update.

The format for REST PUT\Patch is
https:// instancename .service-now.com/api/now/table/ table_name / sys_id ?

 

Chethan Kumar
Mega Contributor

What I meant with "I want the script to read case Sys_ids dynamically" is - I will be integrating SNOW with a third party app. Inputs and triggers for the cases will come from the third party app.

So whenever there is an update from the app, the cases should be created/updated. I believe sys_id should not be given directly and should be coded for Put and Patch. Correct me if wrong.

Sounds like you need a scripted rest API, so you can take advantage of import set/transform map coalesce functionality based on sys_id Toney Vecchio has created an excellent presentation about Scripted Rest API's. https://community.servicenow.com/community?id=community_article&sys_id=d5c94462dbf557002328f3231f96197a and a video of his presentation https://www.youtube.com/watch?v=DyIuma1cZrg

Mayank Agrawal1
ServiceNow Employee
ServiceNow Employee

Hi @Chethan Kumar - I am a product manager at ServiceNow working on enhancing some of these apis for better support for external applications for our customers. Can you please describe your business scenario so that we can provide better features on these APIs?