Fetch Response details and update worknote
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-02-2025 07:00 AM
hi
I am using REST method to POST. this is triggered via script include.
in outbound Http log .
please suggest how to fetch this message in script include.
Thanks
Ujjwal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2025 12:42 AM
hi @Ankur Bawiskar
i ma not able to get this 500 error message in response( in script include).
Thanks
Ujjwal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2025 12:48 AM
you already got you said using
response.getBody()
Now to know the http status you can use this response.getStatusCode()
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2025 04:49 AM
what I informed is
i am getting two different response
- system log -> outbound https requests : here i am getting response body , which i need to show in work note
- getBody() in script include, this is not same as #1
var response = r.execute();
var responseBody = response.getBody(); // this gives different reponse ,not same as system log
var httpStatuscode = response.getStatusCode();
response body in different in #1 and #2 . this is what i have informed in my 1st reply.
Please suggest.
Thanks
Ujjwal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2025 05:16 AM
please check with 3rd party team
Ideally if it's error code 500 then they should give some standard response body and not the body which has HTML data.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader