I am facing one issue during integration between two service now instance using rest import set api

abhisekpramanik
Tera Contributor

Hi Guys,

I am facing one issue during integration between two service now instance using rest import set api . I am trying rest outbound to create record from one snow to another snow instance using rest import set api and I able to create successfully but don't able to receive any response with target record id and sys_id. In table level api I got the response as expected. Is there any difference to get response in import set api? Please assist.

abhiek

 

 

6 REPLIES 6

Maik Skoddow
Tera Patron
Tera Patron

Hi

if you really want us to help you, we need the complete configurations, as we have no access to your instance and therefore have no idea where you are stuck.

Kind regards
Maik

Hi Maik,

I have implemented below code .

var request = new sn_ws.RESTMessageV2('Incident Integration', 'Creation of Incident');
request.setStringParameter('caller', current.caller_id);
request.setStringParameter('short_description', current.short_description);
request.setStringParameter('description', current.description);
request.setStringParameter('impact', current.impact);
request.setStringParameter('category', current.category);

var response = request.execute();
var requestbody = request.getRequestBody();
var responseBody = response.getBody();
var httpsstatus = response.getStatusCode();
gs.log(responseBody, 'Incident outbound testing');
responceJSON = responseBody.substring(10, responseBody.length - 1);
parsedJSON = JSON.parse(responceJSON);
var targetIncidentNumber = parsedJSON['number'];
var targetIncidentSysId = parsedJSON['sys_id'];
var logString = 'Target Incident Number - ' + targetIncidentNumber + '\nTarget Incident SysId -' + targetIncidentSysId;

But in responseBody i am getting blank no response come but it is working when I am using table level API only.

Abhisek

shloke04
Kilo Patron

Hi,

Can you share your details on what you have implemented so far to assist you further?

Regards,

Shloke

Hope this helps. Please mark the answer as correct/helpful based on impact.

Regards,
Shloke

Hi shloke,

I have implemented below code .

var request = new sn_ws.RESTMessageV2('Incident Integration', 'Creation of Incident');
request.setStringParameter('caller', current.caller_id);
request.setStringParameter('short_description', current.short_description);
request.setStringParameter('description', current.description);
request.setStringParameter('impact', current.impact);
request.setStringParameter('category', current.category);

var response = request.execute();
var requestbody = request.getRequestBody();
var responseBody = response.getBody();
var httpsstatus = response.getStatusCode();
gs.log(responseBody, 'Incident outbound testing');
responceJSON = responseBody.substring(10, responseBody.length - 1);
parsedJSON = JSON.parse(responceJSON);
var targetIncidentNumber = parsedJSON['number'];
var targetIncidentSysId = parsedJSON['sys_id'];
var logString = 'Target Incident Number - ' + targetIncidentNumber + '\nTarget Incident SysId -' + targetIncidentSysId;

But in responseBody i am getting blank no response come but it is working when I am using table level API only.

Abhisek