one ServiceNow instance to Another ServiceNow integration
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-03-2023 11:26 PM - edited 08-04-2023 12:41 AM
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);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-04-2023 01:43 AM
there is some ACL which is blocking
Did you check and debug that?
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-07-2023 12:06 AM
yes there is no ACL running on the endpoint table