//===== [ws] Begin Unifi Auto Generated Code =====//
* This code (between the Begin and End comments) is generated from the
* Field and Field mapping records which are configured as part of the integration.
* All code either above or below the comments will be automatically maintained
* through the build cycle.
* WARNING: Do not edit the Begin or End comments.
x_snd_eb.ws_console.checkpoint("MessageScript")
x_snd_eb.ws_console.execute("Mapping incident.caller_id [x_snd_eb_field.do?sys_id=3a5cbbbe1b51b81090dfdb9ebd4bcb66]", function () {
log.debug("Field map: PI - String [x_snd_eb_field_map.do?sys_id=da997f7a1b51b81090dfdb9ebd4bcb5e]");
var default_value = (function () {
// Determines whether this instance of the field map is for a mandatory field
var is_mandatory = false;
$stage.caller_id = '' + (source.caller_id || default_value);
} else if (source.caller_id != '') {
$stage.caller_id = '' + source.caller_id;
x_snd_eb.ws_console.execute("Mapping incident.short_description [x_snd_eb_field.do?sys_id=49debf3e1b51b81090dfdb9ebd4bcba5]", function () {
log.debug("Field map: PI - String [x_snd_eb_field_map.do?sys_id=da997f7a1b51b81090dfdb9ebd4bcb5e]");
var default_value = (function () {
// Determines whether this instance of the field map is for a mandatory field
var is_mandatory = false;
$stage.short_description = '' + (source.short_description || default_value);
} else if (source.short_description != '') {
$stage.short_description = '' + source.short_description;
x_snd_eb.ws_console.execute("Mapping incident.state [x_snd_eb_field.do?sys_id=f32e8cc31b91b81090dfdb9ebd4bcb09]", function () {
log.debug("Field map: PI - Choice [x_snd_eb_field_map.do?sys_id=c7b97f7a1b51b81090dfdb9ebd4bcb62]");
var default_value = (function () {
var is_mandatory = false;
if (!source.state.nil()) {
field_choice = new GlideRecord('x_snd_eb_field_choice');
field_choice.addQuery('table', '=', 'incident');
field_choice.addQuery('element', '=', 'state');
field_choice.addQuery('integration', '=', '27be43a91b9db41090dfdb9ebd4bcb2e');
field_choice.addQuery('field.message', '=', '');
field_choice.addQuery('direction', '=', 'Outbound');
field_choice.addQuery('value', '=', source.state);
field_choice.addQuery('active', '=', 'true');
if (field_choice.next()) {
$stage.state = '' + field_choice.external_value;
$stage.state = '' + (source.state || '');
$stage.state = '' + (source.state || '');
var error = x_snd_eb.ws_console.findCheckpointError("MessageScript");
if (error) throw error.message;
//===== [ws] End Unifi Auto Generated Code =====//