Sometimes there is a need to receive messages from an external system for records which exist in your system, but aren't bonded in Unifi.
To do this setup an inbound create message for the target integration, this will ensure that the bond is created. Add the code below to the top of your stage to target script, before any auto generated code. It will look up the existing record and repoint Unifi to use that record instead of creating a new one.
var existing =newGlideRecord('change_request');existing.addQuery(...); // Your look up code here - assuming other system knows ServiceNow sys_id/numberexisting.query();if (!existing.next()) {throw'Target record with ID '+/*whatever you use for your id here*/+' not found.';}target.$model.setRecord(existing);target =target.$model.getRecord();bond.setTarget(target.$model);bond.setValue('internal_reference',target.number);transaction.$model.setTarget(target);bond.shouldCommitTarget(false);bond.commit();bond.shouldCommitTarget(true);