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
Tera Expert

@Ankur Bawiskar any comments?

Hi @jobin1 ,

 

Please check there is a create/write acl on the table that is restricting the operation.

Please check the access of the user which you are using, is that user have the access to create access on that table.

 

Thank you

Ankur Bawiskar
Tera Patron
Tera Patron

@jobin1 

So what's the issue?

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

I'm getting below error while the test run.

{"error":{"message":"Operation Failed","detail":"ACL Exception Insert Failed due to security constraints"},"status":"failure"}