- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-27-2023 03:33 AM
We have setup one REST message integration from our serviocenow to 3rd party ServiceNow instacne between SC task.
So whenever we attach any attchment to our task it should sent that attachment to 3rd party task, but getting error as mentioned in below screenshot. please suggest. as its not passing the attachment.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2023 07:52 AM
Instead of using setStringParameterNoEscape() function try to create a json format. setStringParameterNoEscape() function is mostly used for formdata format of rest api request body whereas as per you requirement you need to have a raw data format in json. for that you need to try using below code to create a JSON
var r = new sn_ws.RESTMessageV2('SOCIntegrationTask', 'Update Task');
var body = '{ "application" : "' + current.u_application + '", "taskid" : "' + current.u_task_id + '", "status" : "' + stateChange + '", "targetassignmentgroup" : "' + assignmentGroup + '"}';
r.setRequestBody(body);
var response = r.execute();
You are getting HTTP 500 which means internal server error. This usually happens when server is not able to understand what needs to be execute or what unable to understand request body parameter. Therefore try the above format for request body.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-30-2023 07:52 AM
Instead of using setStringParameterNoEscape() function try to create a json format. setStringParameterNoEscape() function is mostly used for formdata format of rest api request body whereas as per you requirement you need to have a raw data format in json. for that you need to try using below code to create a JSON
var r = new sn_ws.RESTMessageV2('SOCIntegrationTask', 'Update Task');
var body = '{ "application" : "' + current.u_application + '", "taskid" : "' + current.u_task_id + '", "status" : "' + stateChange + '", "targetassignmentgroup" : "' + assignmentGroup + '"}';
r.setRequestBody(body);
var response = r.execute();
You are getting HTTP 500 which means internal server error. This usually happens when server is not able to understand what needs to be execute or what unable to understand request body parameter. Therefore try the above format for request body.