Update Incident using PUT API

madanm7786
Mega Guru

Hi All,

I am trying to integrate SN1 to SN2 using REST.

When incident is created in SN1, incident is created in SN2 and i am storing SN2 incident in Corellation id field in SN1. I have used import set integration for this. I have used POST method and it is working fine.

Now when incident is updated in SN2(state resolved) i need to update the same in incident in SN1. I have created import set table in SN1 and mapped the field in transform map and made corellation id field as colease and using PUT method from SN2.

But i am getting an error "{"error":{"message":"Method not Supported","detail":"PUT method not supported for API"},"status":"failure"}".

Please help me on this.

Thanks,

Maddy

1 ACCEPTED SOLUTION

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Madan,

 

For REST Import Set only following methods are available.

Only GET and POST is allowed.

Change from PUT to POST and check again.

 

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

View solution in original post

5 REPLIES 5

Ankur Bawiskar
Tera Patron
Tera Patron

Hi Madan,

 

For REST Import Set only following methods are available.

Only GET and POST is allowed.

Change from PUT to POST and check again.

 

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 it worked.

But if i need to use PUT or PATCH method. How to use it.

Also can we do the same using scripted web service.

 

Thanks,

Maddy

Can you please provide any sample example if you have any to update incident state using scripted web service.

 

Thanks,

Maddy

Hi Madan,

 

Following links you can refer:

https://docs.servicenow.com/bundle/geneva-servicenow-platform/page/integrate/custom_web_services/concept/c_ScriptedRESTAPIExamples.html

http://www.cavucode.com/blog/2016/5/4/genevagem-scripted-rest-services

https://community.servicenow.com/community?id=community_question&sys_id=135fb2a9db58dbc01dcaf3231f9619af

 

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