User Tools

Site Tools


common_incident_to_salesforce

ServiceNow-Salesforce SIAM Integration Quick Start Guide

Dubnium

A ServiceNow-Salesforce Perspectium SIAM Integration allows you to easily share and integrate your incident and case records between ServiceNow and Salesforce instances. To get started with your ServiceNow-Salesforce SIAM Integration, follow the steps in this guide for ServiceNow-side Installation and Configuration as well as Salesforce-side Configuration.

ServiceNow-side Installation and Configuration Steps

Step 1: Install the Required ServiceNow Update Sets

To begin integrating Salesforce with your ServiceNow instance via Perspectium SIAM, first request the download links for the following Perspectium for ServiceNow update sets from support@perspectium.com:

  1. Perspectium for ServiceNow update set
  2. Perspectium for Common Endpoint update set
  3. Perspectium Common Document update sets (Common Incident, Common Change, Common Problem, Common Request)
  4. Perspectium for Salesforce update set

After obtaining these update sets, follow the steps to install your update sets for the first time. If upgrading from a previous update set version, follow the steps for upgrading your update sets.

Step 2: Create a Subscribed Queue

In order to receive messages from Salesforce, you will need to create a subscribed queue in ServiceNow. By default, Perspectium's Message Broker Service (MBS) will push messages from Salesforce out to psp.out.servicenow.your_company_here.

To create a subscribed queue:

  1. In the left side navigation window, navigate to Perspectium > Replicator > Subscribed Queues or simply type Subscribed Queues to access the Subscribed Queues form.
  2. Click New to create a new subscribed queue record.
  3. In the Name field, type psp.out.servicenow.your_company_here. Then, check the box marked Active to activate the queue.
  4. Type your MBS username, password, and encryption key in the appropriate fields. NOTE: This information can be found by navigating to Perspectium > Properties.
  5. Click Get Queue Status to verify that the queue is active. Then, click Submit to save your newly created subscribed queue.


Step 3: Create a Shared Queue

After creating your subscribed queue, you will next need to create a shared queues for your Salesforce instance to share to.

  1. In the left side navigation window, navigate to Perspectium > Replicator > Shared Queues or simply type Shared Queues to access the Shared Queues form.
  2. Click New to create a new shared queue record.
  3. In the Name field, type psp.in.siam.client.salesforce. Then, check the box marked Active to activate the queue.
  4. Type your MBS username, password, and encryption key in the appropriate fields. NOTE: This information can be found by navigating to Perspectium > Properties.
  5. Click Get Queue Status to verify that the queue is active. Then, click Submit to save your newly created shared queue.


Step 4: Create a Dynamic Share

To create a dynamic share for your ServiceNow-Salesforce SIAM integration, follow these steps:

  1. In ServiceNow's left side navigation bar, navigate to Perspectium > Replicator > Dynamic Share or simply type dynamic share in the navigation window to access the Dynamic Share form.
  2. Click New to create a new dynamic share.
  3. Type any Name for your dynamic share. Then, choose the table you want to share to from the Table dropdown.
  4. Check the Active box to activate your dynamic share.
  5. Choose your trigger conditions on the Trigger Conditions tab. Then, click the Additional Settings tab.
  6. Select the table map for Salesforce based on the type of process you are integrating (incident, change, problem, or request).
  7. In the Target Queue field, type psp.in.siam.client.salesforce.
  8. Click the Filter and Enrichment tab and add the code below to the Before share script. After adding this code, click Submit to finish creating your dynamic share.
if (psp_action == 'update' && current.correlation_id == ''){
	psp_action = 'deferred';
}




Step 5: Create an Inbound Transform Map

The outbound table map you selected in Step 3 will handle the conversion of ServiceNow incidents into Salesforce cases. However, you will also need to create an inbound transform map in ServiceNow that will convert your incoming fields and values from Salesforce.

To create an inbound transform map:

  1. In ServiceNow's left side navigation bar, navigate to System Import Sets > Administration > Create Transform Map or simply type and then click Create Transform Map.
  2. For the Name field, type SFDC Case to Incident.
  3. Select PSP Common Incident from the Source table dropdown.
  4. Select Incident from the Target table dropdown.
  5. Click Submit to finish creating your inbound transform map.
  6. Now, click back into the inbound transform map you created and scroll down to the Field Maps tab.
  7. Click New to create new field maps with the values indicated in the screenshot below.


After creating and defining the field values, you will also need to add some onAfter transform scripts so that ServiceNow will know how to handle, update, and direct the values and attachments for inbound messages from Salesforce.

To add the onAfter transform scripts:

  1. Click back into the inbound transform map you just created and click the Transform Scripts tab.
  2. Select onAfter from the When dropdown.
  3. Add the code for onAfter Script #1 below within the scripting window. Then, click Submit.
  4. Repeat #1-3 for onAfter Script #2.

onAfter Script #1:

(function runTransformScript(source, map, log, target ) {
	var ogr = new GlideRecord("psp_out_message");
	var pspS = new PerspectiumEncryption();
	var StringUtil = (typeof GlideStringUtil != 'undefined') ? new GlideStringUtil() : new Packages.com.glide.util.StringUtil();
	ogr.addQuery("state", "deferred");
	ogr.addQuery("u_extra", 'CONTAINS', "number=" + source.u_number);
	ogr.queryNoDomain();

	while (ogr.next()) {
		var names = String(ogr.name).split(".");
		
		if (names.length != 2 || names[1] != "update"){
			continue;
		}
		
		var decodedValue = StringUtil.base64Decode(ogr.value);
		
		ogr.value = StringUtil.base64Encode(decodedValue.replace("<correlation_id/>", "<correlation_id>" + source.u_correlation_id + "</correlation_id>"));
		ogr.state = "ready";
		ogr.update();
	}
})(source, map, log, target);

onAfter Script #2:

(function runTransformScript(source, map, log, target /*undefined onStart*/ ) {
	
	if(source.u_number != ""){
		return;
	}
	
	var qgr = new GlideRecord("u_psp_queues");
	var queue = "";
	qgr.addQuery("u_name", "psp.in.siam.client.salesforce");
	qgr.query();
	if (!qgr.next()){
		return;
	}
	
	queue = qgr.sys_id;
	var qc = new GlideRecord("psp_replicate_conf");
	qc.addQuery("table_name", "incident");
	qc.addQuery("u_target_queue", qgr.sys_id);
	qc.query();
	if (!qc.next()){
		return;
	}
	
	var gr = new GlideRecord("incident");
	gr.addQuery("sys_id", target.sys_id);
	gr.query();
	if (gr.next()){
		var pspR = new PerspectiumReplicator();
		pspR.shareRecord(gr, "incident", "update", qc.sys_id);
	}
})(source, map, log, target);



Salesforce-side Configuration Steps

Steps 6 & 7: Install the Salesforce Package & Configure Your Salesforce Organization

To install the Perspectium for Salesforce package on your Salesforce instance, follow the steps described here.

Then, configure your Salesforce Organization by following the steps described here.

Step 8: Create a Custom Case Field

Creating a custom case field will allow for the storing of ServiceNow incident numbers when messages are sent over to ServiceNow.

To create a custom case field:
1. Log into Salesforce and make sure you have enabled the Salesforce Classic view. If you are in Salesforce Lightning view, click your avatar in the top right-hand corner. Then, click Switch to Salesforce Classic.
2. At the top right-hand corner of the page, click Setup.


3. At the left side of the page, there is a side bar with a search function at the top. Type case and then click the Fields option under Cases. This will bring you to the Case Field page.


4. On the Case Field page, scroll down to the Case Custom Fields and Relationships section and click New.


5. Select the Text option. Then, click Next.


6. Type a name for your custom field under Field Label. The Field Name for your custom field will then be automatically generated.


7. Give viewing permissions to any applicable users. In the example below, everyone is granted permission to view the custom field.


8. Lastly, check the boxes for Add Field, Case Layout, and Close Case Layout. Then click Save.


Step 9: Create Salesforce Shared and Subscribed Queues

Next, you will need to create a share queue and a subscribed queue in order to exchange messages with ServiceNow.

To create your shared queue in Salesforce:

  1. At the top navigation bar underneath the Perspectium logo, click Queues. Then, click New Queue to create a new queue.
  2. For the Queue Name field, type psp.in.siam.provider.salesforce.
  3. Select Share from the Direction dropdown.
  4. Add your Perspectium MBS credentials in the associated fields. Then, click Save.


To create your subscribed queue in Salesforce:

  1. At the top navigation bar underneath the Perspectium logo, click Queues. Then, click New Queue to create a new queue.
  2. For the Queue Name field, type psp.out.salesforce.your_salesforce_instance_number_here.
  3. Select Share from the Direction dropdown.
  4. Add your Perspectium MBS credentials in the associated fields. Then, click Save.


Step 10: Create Your Salesforce Dynamic Share

A dynamic share table is necessary for records to be sent out to ServiceNow upon creation, update, or deletion.

To create a Salesforce dynamic share:

  1. At the top navigation bar under the Perspectium logo, click Dynamic Shares. Then, click New Dynamic Share to create a new dynamic share.
  2. Type any Name for your dynamic share.
  3. Select Case from the Table dropdown.
  4. Check the box next to Active.
  5. Check the boxes to indicate that Salesforce case records should be dynamic shared out to ServiceNow when case records are Created, Updated, and/or Deleted. Optionally, you can check Include Attachments if you want to send out attachments along with your Salesforce case records. You also have the option to create Filters here for your Salesforce dynamic share if you wish.
  6. For the Target Queue, select psp.in.siam.client.salesforce.
  7. Scroll to the bottom of the screen and click Save. All other required fields will then be created automatically. To complete the configuration of your Salesforce dynamic share, click Save Trigger.

Other ServiceNow-Salesforce SIAM Integration Topics

For more information or to add custom configurations for your ServiceNow-Salesforce SIAM integration, choose from one of the topics listed below:

common_incident_to_salesforce.txt · Last modified: 2018/11/01 18:48 by timothy.pike