- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2017 12:29 AM
Hi,
I have a requirement like, when user update state, Comments, Priority etc.. in third party application, then it should be updated in servicenow
I am using the scripted rest api PUT method to update the fields in servicenow.
Could you please help,
Script Include:
Solved! Go to Solution.
- Labels:
-
Integrations
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2017 10:45 AM
Hi Harish,
As you said when ticket is updated in third party application then it should update the same in ServiceNow.
Are you saying that you have exposed the Scripted REST API to the third party.
I could see that you have used PUT method i.e. fine.
But the way you are fetching the response is incorrect . use following
var requestBody = request.body.dataString;
try to add logs to check requestBody is received correctly in your scripted rest api resource
also you are not sending the id as json key while consuming the REST endpoint so how you will get the value by parsing the json
the json parsing you have used is not correct. use following
var parser = new global.JSON();
var parsedData = parser.decode(requestBody);
var id = parsedData.work_notes;
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
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2017 01:06 AM
Have you used the REST API explorer to test if the incident can be updated correctly?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2017 02:00 AM
Hi Sergiu,
Yes I have tested with REST explorer and it is working good.
Now What is the next step to make fields and worknotes update in servicenow.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2017 02:34 AM
Can you login in the instance using REST details and update incidents?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-29-2017 10:03 AM
Hi Ankur,
Could you please provide me some help on Inbound Ticket updation.
when state is changed in third party application, then it should update the same in servicenow.
Script include which I posted is not triggering and I am not getting what is the issue.
Thanks.