one ServiceNow instance to Another ServiceNow integration

jobin1
Tera Expert

Hi all,

 

I need to pass few fields like instance name, version etc from instance "a" to another instance "b" the table called instance management. the approach I am trying is like below.
Instance A 
1.BR after update of sys properties (instance name and version) and here calling rest message also.

2. Rest message->end point will be instance b url+table name(url+instance management) and POST method
3.authorization basic and same profile created on instance b as well.

 

Instance B

1.one new staging table with same values as instance management table(inbound web service)
2.new transform map source table is new staging table and target table will be instance management


Now when ever the BR trigger it will send rest message and while the data insertion happening in staging table by default the transform map will start executing and data will be moving to  instance management table ?

 

 

BR 

(function executeRule(current, previous /*null when async*/ ) {


var instanceName = gs.getProperty('instance_name');
gs.log("sntosn1instancename" + instanceName);
var InstanceType = gs.getProperty('sn_appclient.instance_type');
gs.log("sntosn2InstanceType" + InstanceType);
var InstanceVersion = gs.getProperty('mid.version');
gs.log("sntosn3InstanceVersion" + InstanceVersion);
try {
var r = new sn_ws.RESTMessageV2('TESTSNTOSN', 'post');
r.setStringParameterNoEscape('InstanceVersion', 'InstanceVersion');
r.setStringParameterNoEscape('instanceName', 'instanceName');
r.setStringParameterNoEscape('InstanceType', 'InstanceType');

var response = r.execute();
var responseBody = response.getBody();
var httpStatus = response.getStatusCode();
} catch (ex) {
var message = ex.message;
}




})(current, previous);

6 REPLIES 6

@jobin1 

there is some ACL which is blocking

Did you check and debug that?

Regards,
Ankur
Certified Technical Architect  ||  9x ServiceNow MVP  ||  ServiceNow Community Leader

yes there is no ACL running on the endpoint table

jobin1_0-1691391994586.png