ServiceNow App Migration Guide

This is a guide for updating the BigPanda App to version 2.x

Key Features

  • A new configuration UI
  • The Incidents sync is a pull mechanism powered by a configurable Scheduled Job within ServiceNow
  • Key syncs between incidents are now driven by ServiceNow Events
  • A new BigPandaUtility Script Include helps parse the BigPanda Incident data for customization on hand

Prerequisites

  • Admin access to ServiceNow

❗️

Before Updating

Please review the designated migration sections for instructions on how to save data prior to updating the app

App Update Process

  1. Navigate to System Applications > All Available Applications > All
  2. Find the BigPanda app and click on update
  3. The application will take some time to update all relevant files
  4. Each module will need to be looked at to compare and merge new files from the update to any defaults that were not overwritten.

📘

Incidents, Changes, and CMDB Modules

If you were on a version of the app that did not include the Changes and/or CMDB module, the next two sections can be skipped as versions will not be available.

If the incidents module was never leveraged, the Incidents Migration can also be skipped.

Incidents Migration

Previously denoted as ticketing, the incidents module has all the relevant files for creating and syncing BigPanda Incidents to ServiceNow Incidents

Transform Map Updates

The transform map does not get updated automatically if it was modified prior to this update. Please refer below to the various updates required to allow the new logic to work

Coalesce Field

  1. Confirm the Create new record on empty coalesce fields is checked
  2. Confirm the following mapping is set to true on the coalesce field
Source FieldTarget FieldsDescription
u_incident_sys_idsys_idBigPanda caches the ServiceNow Incident sys_id after its initially created

Mapping updates

These following updates are recommended for the target fields.

  • Find the target field defined below and click it
  • Check Use source script and provide the script defined for each target field

Assignment_group

answer = (function transformEntry(source) {
    // Instantiate BigPanda Utility Object with source
    var bpUtils = new x_bip_panda.BigPandaUtility(source);
    
    var assignment_group = null;
    
    // Validates if this field can be updated on an update action
    if (bpUtils.canUpdate(action, 'assignment_group')){
        // Attempts to get the assignment group from the source as the primary option
        // Falls back to retrieving the input from the configuration form
        assignment_group = source.assignment_group || gs.getProperty('x_bip_panda.assignmentGroup');
    }
    
    // If additional logic is required
    // Retrieves the BigPanda Incident
    // var bpIncident = bpUtils.getIncident(); // uncomment if needed
    
    // Custom logic goes here
    
    return assignment_group; 

})(source);

Caller_id

answer = (function transformEntry(source) {
    // Instantiate BigPanda Utility Object with source
    var bpUtils = new x_bip_panda.BigPandaUtility(source);
    
    var caller_sys_id = null;

    // Validates if this field can be updated on an update action
    if (bpUtils.canUpdate(action, 'caller_id')){
        // Attempts to retrieve input from the configuration form
        // If no email is retrieved, the default is the email sender from the BigPanda Share 
        var caller_id_email = gs.getProperty('x_bip_panda.callerId', source.u_bp_sender_email);

        // Performs a lookup with the provided email and returns the associated sys id
        caller_sys_id = bpUtils.getUserByProperty(caller_id_email,"caller_id");
    }
    
    return caller_sys_id;

})(source);

CMDB_CI

answer = (function transformEntry(source) {
    // Instantiate BigPanda Utility Object with source
    var bpUtils = new x_bip_panda.BigPandaUtility(source);
    
    var cmdb_ci = null;
    
    // Validates if this field can be updated on an update action
    if (bpUtils.canUpdate(action, 'cmdb_ci')){
        // Capture default cmdb ci field
        var cmdb_ci_field = source.u_bp_cmdb_ci;
        
        // Override the cmdb ci field if a value exists in the configuration form
        if (gs.getProperty('x_bip_panda.cmdbCiField')) {
            cmdb_ci_field = gs.getProperty('x_bip_panda.cmdbCiField');
        }
        
        // If the source provides a value for the cmdb_ci, leverage it
        // Otherwise default to retrieving the value for the field in the primary alert
        cmdb_ci = source.cmdb_ci || bpUtils.getPrimaryAlertTag(cmdb_ci_field);
    }
    
    return cmdb_ci;

})(source);

Description

answer = (function transformEntry(source) {
    // Instantiate BigPanda Utility Object with source
    var bpUtils = new x_bip_panda.BigPandaUtility(source);
    var description = null;
    
    // Validates if this field can be updated on an update action
    if (bpUtils.canUpdate(action, 'description')) {
        description = source.description;
    }
    
    // Example of custom logic
    // Retrieve the BigPanda Incident Data
    // var incident = bpUtils.getIncident();
    // CUSTOM LOGIC HERE
    // description = CUSTOM_LOGIC_RESULT;

    return description;
})(source);

Opened_at

answer = (function transformEntry(source) {
    // Instantiate BigPanda Utility Object with source
    var bpUtils = new x_bip_panda.BigPandaUtility(source);
    
    var opened_at = null;
    
    // Validates if this field can be updated on an update action
    if (bpUtils.canUpdate(action, 'opened_at')){
        // Set default unix time from the BigPanda Incident start time
        var time_to_use = source.opened_at;
        
        // Converts provided unix time to ServiceNow GlideDateTime
        opened_at = bpUtils.getTimeByProperty(time_to_use, 'opened_at');
    }
    
    return opened_at;

})(source);

Opened_by

answer = (function transformEntry(source) {
    // Instantiate BigPanda Utility Object
    var bpUtils = new x_bip_panda.BigPandaUtility(source);
    
    var opened_sys_id = null;
    
    // Validates if this field can be updated on an update action
    if (bpUtils.canUpdate(action, 'opened_by')){
        // Attempts to retrieve input from the configuration form
        // If no email is retrieved, the default is the email sender from the BigPanda Share 
        var opened_by_email = gs.getProperty('x_bip_panda.openedBy', source.u_bp_sender_email);
        
        // Performs a lookup with the provided email and returns the associated sys id
        opened_sys_id = bpUtils.getUserByProperty(opened_by_email, 'opened_by');
    }
    
    return opened_sys_id;

})(source);

Resolved_at

answer = (function transformEntry(source) {
    // Instantiate BigPanda Utility Object with source
    var bpUtils = new x_bip_panda.BigPandaUtility(source);
    
    var resolved_at = null;
    
    // Validates if this field can be updated on an update action
    if (bpUtils.canUpdate(action, 'resolved_at')){
        // Set default unix time from the BigPanda Incident start time
        var time_to_use = source.resolved_at;
        
        // Converts provided unix time to ServiceNow GlideDateTime
        resolved_at = bpUtils.getTimeByProperty(time_to_use, 'resolved_at');
    }
    
    return resolved_at;

})(source);

Resolved_by

answer = (function transformEntry(source) {
    // Instantiate BigPanda Utility Object with source
    var bpUtils = new x_bip_panda.BigPandaUtility(source);
    var isResolved = (source.u_bp_incident_status.toLowerCase() === 'ok');
    var resolved_sys_id = null;

    // Validates if this field can be updated on an update action
    // And that the BigPanda Incident Status is resolved
    if (bpUtils.canUpdate(action, 'resolved_by') && isResolved){
        // Attempts to retrieve input from the configuration form
        // If no email is retrieved, the default is the email sender from the BigPanda Share 
        var resolved_by_email = gs.getProperty('x_bip_panda.resolvedBy', source.u_bp_sender_email);
        
        // Performs a lookup with the provided email and returns the associated sys id
        resolved_sys_id = bpUtils.getUserByProperty(resolved_by_email, 'resolved_by');
    }
    
    return resolved_sys_id;
    
})(source);

Short_description

answer = (function transformEntry(source) {
    // Instantiate BigPanda Utility Object with source
    var bpUtils = new x_bip_panda.BigPandaUtility(source);
    
    var short_description = null;
    
    // Validates if this field can be updated on an update action
    if (bpUtils.canUpdate(action, 'short_description')){
        // Sets the default short description
        short_description = source.short_description;
        
        // Sets the short description based on the primary alert definition 
        // in the configuration
        // Retrieve the Primary Property from Primary Alert
        primaryProperty = bpUtils.getPrimaryAlertValue('primaryProperty');

        // Retrieve Value of Primary Property
        primaryValue = bpUtils.getPrimaryAlertTag(primaryProperty);

        // Construct short description string (customize to need)
        short_description = 'BigPanda Incident - ' + primaryValue;
    }

    return short_description;
})(source);

Work_notes

Source FieldTarget Field
commentswork_notes

Changes Migration

The Changes module has had some minor changes to the Business Rule that need to be addressed

Save Existing Data

  1. Navigate to BigPanda > Changes
  2. The Changes Business Rule will have a script under the advance tab.
  3. Save values within the options object.
// Configuration for the BigPanda Changes Module
var options = {
  "api_key": "API_KEY", // your BigPanda API Key
  "app_key": "APP_KEY", // your BigPanda Integration App Key
  // Mapping of BigPanda change fields => ServiceNow Change Table Columns
  "fieldMapping": {
    "start": "start",
    "end": "end",
    "state": "state", // defaults to "state", can be overridden
    "identifier": "number", // defaults to change "number", can be overridden
    "summary": "short_description" // defaults to "short_description", can be overridden
  },
  // Mapping of BigPanda change states to ServiceNow states
  // these are general defaults but you can customize to align with your instance
  "stateMapping": {
    "Planned": [ "New", "Assess", "Authorize", "Scheduled" ],
    "In Progress": [ "Implement", "Review" ],
    "Done": [ "Closed" ],
    "Canceled": [ "Cancelled" ] 
  },
  // Array of tags which should NOT appear in the BigPanda Changes UI
  "hide": [ "HIDDEN_TAG_1", "HIDDEN_TAG_2" ]
};

Update Configuration UI

  1. Update the BigPanda App
  2. Navigate to BigPanda > Configuration
  3. Under the Changes section, enter the data saved from the changes business rule
  4. Mark the section as active to enable this module
  5. Save the form

Compare and Merge

  1. Navigate to BigPanda > Changes > Changes Business Rule
  2. Scroll down to Versions
  3. Two versions should be present. An Update Set: Default and a Store Application: BigPanda source
  1. Select both files and click on the Actions dropdown to find the compare option
  2. A side-by-side comparison of the Selected Version (Store Application: BigPanda) and the Current Version (Update Set: Default) will now be in view
  3. Confirm the application scope is BigPanda to be able to view the Revert to Selected Version and Save Merge buttons on the top right of the screen.
  4. Click on the Revert to Selected Version button to set the current state to the Store Application: BigPanda source

CMDB Migration

The CMDB module has had some minor changes to the Scheduled Job that need to be addressed

Save Existing Data

  1. Navigate to BigPanda > CMDB
  2. The CMDB Processing Scheduled Job will have a script section
  3. Make sure to save all tables/views with their respective options
var tablesAndViews = [
    {
        name: "u_hosts_apps", // Name of transmitted table or view
        query: null, // [optional] A query to filter the table's records
        key: "a_u_app", // The key column (e.g. host). Make sure the key column is indexed in the table
        columns: ["h_u_name", "h_u_host_id"], // String array with all required columns to send
       columnToTagMapping: {"h_u_name": "host"} // Mapping of ServiceNow columns to BigPanda tags
    },
    {
        name: "u_bp_apps",
        query: null,
        key: "u_app",
        columns: ["u_host_id"],
        columnToTagMapping: {"u_app": "app"}
    }
];
var opts = {
   "pageSize": 1000, // Max records per REST request
   "url": "https://integrations.bigpanda.io/servicenow/cmdb/ingest",
   "apiToken": "XXXX", // [optional] Used for authentication for the REST endpoint
   "maxRetries": 3, // Number of retries to try before giving up
   "maxPages": 1000, // Maximum pages to transmit, even if more data is available
   "retrySeconds": 60 // Sleep time between retries
};

Update Configuration UI

  1. Update the BigPanda App
  2. Navigate to BigPanda > Configuration
  3. Under the CMDB section, enter the data saved from the CMDB Scheduled Job
  4. Mark the section as active to enable this module
  5. Save the form

Update the Scheduled Job Script

  1. Navigate to BigPanda > CMDB > CMDB Processing Scheduled Job
  2. Confirm the information has already been previously captured and saved to the configuration UI.
  3. Copy and paste the code below. Save the file.
/*
 * Configuration for the BigPanda CMDB Module
 *
 * For tablesAndViews please provide an array of configuration objecst for each table or view you wish to send
 *
 * For opts please provide the general configuration for the module
 */

// start with empty table and view data
var tablesAndViews = JSON.parse(gs.getProperty("x_bip_panda.CMDBConfigList"));

var opts = {
    "pageSize": gs.getProperty("x_bip_panda.CMDBPageSize"), // Max records per REST request
    "url": gs.getProperty("x_bip_panda.CMDBEndpoint"),
    "apiToken": gs.getProperty("x_bip_panda.bearerToken"), // Used for authentication for the REST endpoint
    "maxRetries": gs.getProperty("x_bip_panda.CMDBMaxRetries"), // Number of retries to try before giving up
    "maxPages": gs.getProperty("x_bip_panda.CMDBMaxPages"), // Maximum pages to transmit, even if more data is available
    "retrySeconds": gs.getProperty("x_bip_panda.CMDBRetryInterval") // Sleep time between retries
};

gs.info("BigPanda Info: Sending CMDB Data to BigPanda");
var cmdb = new BigPandaCMDB();
cmdb.process(opts, tablesAndViews);

Updated 8 months ago

ServiceNow App Migration Guide


This is a guide for updating the BigPanda App to version 2.x

Suggested Edits are limited on API Reference Pages

You can only suggest edits to Markdown body content, but not to the API spec.