User Tools

Site Tools



This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
common_incident_to_salesforce [2018/09/10 11:19]
timothy.pike [Transform Map]
common_incident_to_salesforce [2019/04/22 16:06] (current)
timothy.pike [ServiceNow-Salesforce SIAM Integration Quick Start Guide]
Line 1: Line 1:
-========== ServiceNow ​Common Incident Configuration ​==========+========== ServiceNow-Salesforce SIAM Integration Quick Start Guide ==========
-The ServiceNow Salesforce SIAM Integration allows for replication of processes between ServiceNow and Salesforce.+<wrap round info>​[[dubnium_release|Dubnium]]</​wrap>​
-The following are the steps to install ​and configure the various components of the Salesforce SIAM integration ​for ServiceNow ​for the first time+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 Installation and Configuration ​====== +===== ServiceNow-side Installation and Configuration ​Steps ===== 
-====Update Sets ====+==== Step 1: Install the Required ServiceNow ​Update Sets ====
-To begin integrating SIAM for Salesforce into your ServiceNow instance you must first install the Perspectium update sets. For the latest update sets, visit the [[updateset_releases|Update Set Releases]] page and request the download links from [[]]. For more information on installing or updating the update sets, visit the [[first_time_update_set_install|first time install]] or [[upgrading_update_set|updating]] pages. +
-\\ \\ +
-The update sets should be installed in this order:  +
-  - Perspectium for ServiceNow update set. +
-  - Perspectium for Common Endpoint update set. +
-  - Perspectium Common Document to integrate (ie. Common Incident, Common Change, etc.) +
-===== Subscribed Queue ===== +To begin integrating ​Salesforce ​with your ServiceNow instance via Perspectium SIAMfirst request the download links for the following Perspectium for ServiceNow ​[[https://​​bundle/​london-application-development/​page/​build/​system-update-sets/​concept/​system-update-sets.html|update sets]] from [[]]
-In order to receive messages from Salesforce, ​we must create a [[replicator_snc_subscribed_queues|subscribed queue]]. By default, ​[[mbs|MBS]] will push messages out to psp.out.servicenow.**your_org_here**. Below is an example of a subscribed queue for ServiceNow to Salesforce.+
-Creating a subscribed queue:  +  ​- Perspectium ​for ServiceNow update set 
-  ​Click on the subscribed queues link under the Replicator tab in the Perspectium ​App +  - Perspectium for Common Endpoint update set 
-  - Create a table with a subscribed queue named psp.out.servicenow.**your_org_here** and fill in the respective credentials to the queue +  - Perspectium Common Document update sets (Common Incident, Common Change, Common Problem, Common Request)
-  - Click on "get queue status"​ and verify that it is active+
-{{:salesforce_shared_queue_common_incident.png|}}+After obtaining these update sets, follow the steps to [[first_time_update_set_install|install your update sets for the first time]]. If upgrading from a previous update set version, follow the steps for [[upgrading_update_set|upgrading your update sets]]. 
 +==== Step 2Create a Subscribed Queue ==== 
 +In order to receive messages from Salesforce, you will need to create a [[replicator_snc_subscribed_queues|subscribed queue]] in ServiceNowBy default, Perspectium'​s [[mbs|Message Broker Service (MBS)]] will push messages from Salesforce out to psp.out.servicenow.**your_company_here**.
-===== Shared Queue ===== +To create a subscribed queue:  
-After creating the [[replicator_snc_subscribed_queues|subscribed queue]]we will next create a dynamic share and shared ​queue. ​Visit the [[replicator_snc_share|Dynamic share]] ​and [[replicator_snc_shared_queues|Shared Queues]] pages for general ​information ​on both of these features\\+  - In the left side navigation windownavigate to **Perspectium** > **Replicator** > **Subscribed Queues** or simply type **Subscribed Queues** to access the Subscribed Queues form. 
 +  - Click **New** to create a new subscribed ​queue record. 
 +  - In the **Name** field, type //​psp.out.servicenow.**your_company_here**//​. Then, check the box marked **Active** to activate the queue. 
 +  - Type your MBS username, password, ​and encryption key in the appropriate fields. __**NOTE**__:​ This information ​can be found by navigating to **Perspectium** > **Properties**. 
 +  - Click **Get Queue Status** to verify that the queue is active. Then, click **Submit** to save your newly created subscribed queue.
-Creating a shared queue:  +^{{ .:salesforce_shared_queue_common_incident.png?800 |}}^
-  - Click on the shared queues link under the Replicator tab in the Perspectium App +
-  - Create a table with a shared queue named and pass in the respective credentials to the queue +
-  -  Click on this "get queue status"​ and verify that it is active +
-  +
 \\ \\
-===== Dynamic Shares ​===== +==== Step 3: Create a Shared Queue ====
-To create your own share for other tables click the Dynamic Shares module under the Perspectium application menu. Click the new button to move on to the Dynamic Share form. Select the desired table to share and select the active checkbox. Then choose your trigger conditions and move to the "​Additional Settings"​ section of the form. Select the table map for Salesforce (it will have been auto generated upon installing the update set) and the table name. Select the Target queue ****. See the [[ replicator_snc_share | dynamic share ]] page for more information.+
-The following images are examples ​for configuring the ServiceNow incident table to share out to Salesforce case object:+After creating your [[replicator_snc_subscribed_queues|subscribed queue]], you will next need to create a [[replicator_snc_shared_queues|shared queues]] ​for your Salesforce instance ​to share to.
-{{:salesforce_dynamic_share_1.png|}} +  - In the left side navigation window, navigate to **Perspectium** > **Replicator** > **Shared Queues** or simply type **Shared Queues** to access the Shared Queues form. 
-{{:salesforce_dynamic_share_2.png|}} +  - Click **New** to create a new shared queue record. 
-{{:salesforce_dynamic_share_3.png|}}+  - In the **Name** field, type //​​. Then, check the box marked **Active** to activate the queue. 
 +  - Type your MBS username, password, and encryption key in the appropriate fields. __**NOTE**__This information can be found by navigating to **Perspectium** > **Properties**
 +  - Click **Get Queue Status** to verify that the queue is active. Then, click **Submit** to save your newly created shared queue. 
 +^{{ :salesforce_shared_queue.png?800 |}}^ 
 +==== Step 4Create a Dynamic Share ==== 
 +To create a [[replicator_snc_share|dynamic share]] for your ServiceNow-Salesforce SIAM integration,​ follow these steps: 
 +  - 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. 
 +  - Click **New** to create a new dynamic share.  
 +  - Type any **Name** for your dynamic share. Then, choose the table you want to share to from the **Table** dropdown.  
 +  - Check the **Active** box to activate your dynamic share. 
 +  - Choose your trigger conditions on the **Trigger Conditions** tab. Then, click the **Additional Settings** tab. 
 +  - Select the table map for Salesforce based on the type of process you are integrating (incident, change, problem, or request).  
 +  - In the **Target Queue** field, type //​​.  
 +  - 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.
-Below is the code for the "​Before share script":​ 
 <​code>​ <​code>​
 if (psp_action == '​update'​ && current.correlation_id == ''​){ if (psp_action == '​update'​ && current.correlation_id == ''​){
Line 51: Line 59:
 </​code>​ </​code>​
-===== Outbound and Inbound Table Maps ===== +^{{:​salesforce_dynamic_share_1.png?750|}}^ 
-The inbound table map will handle the conversion of Salesforce cases into ServiceNow incidents and the outbound table map will handle the conversion of ServiceNow incidents into Salesforce cases+\\ 
-Both table maps are key components for the SIAM integrationSee [[snc_table_maps ​table map ]] page for more information.+^{{:​salesforce_dynamic_share_2.png?750|}}^ 
-==== Incident to Common Incident ==== 
-The outbound table map maps ServiceNow incident field values to Salesforce cases. The images below are examples of the outbound table map for incident to common incident. 
-==== Transform Map ==== 
-You will need to create the inbound transform map in ServiceNow that will convert the incoming fields and values from Salesforce.+==== Step 5: Create an Inbound Transform Map Acknowledgement Script ====
-  - In ServiceNow, navigate ​to **System Import Sets** > **Administration** > **Transform Maps** to open the Table Maps form. +You will need to **add a onAfter transform script** so that ServiceNow will know how to handle, update, and direct ​the values for inbound messages from Salesforce.
-  - Click **New** at the top left-hand corner of the Table Maps form. +
-  - Follow the example of the pictures below and add more fields if necessary.+
 +To add the **onAfter** transform scripts:
 +  - Click back into the inbound transform map you just created and click the **Transform Scripts** tab.
 +  - Select **onAfter** from the **When** dropdown. ​
 +  - Add the code for **onAfter Script** below within the scripting window. Then, click **Submit**. ​
-{{:sfdc_transform_map_1.png|}} +**onAfter Script:**
-{{:​sfdc_transform_map_2.png|}} +
- +
-After creating and defining the field values, we need to add a few transform scripts so that ServiceNow will know how to handle, update, and direct the values & attachments from received messages in the inbound table.  +
- +
-Below is the onAfter transform script that will update deferred messages to have the correct correlation id and vtoken. It will also set the state to "​Ready"​ so that the message can be sent out.+
 <​code>​ <​code>​
-(function runTransformScript(source,​ map, log, target ) { +//​acknowledge 
- var ogr = new GlideRecord("​psp_out_message"​);​ +(function runTransformScript(source,​ map, log, target ​/*undefined onStart*/ ​) {
- var pspS = new PerspectiumEncryption();​ +
- var StringUtil = (typeof GlideStringUtil != '​undefined'​) ? new GlideStringUtil() : new;​ +
- ogr.addQuery("​state",​ "​deferred"​);​ +
- ogr.addQuery("​u_extra",​ '​CONTAINS',​ "​number="​ + source.u_number);​ +
- ogr.queryNoDomain();​+
- while ( { +if(source.u_action ​!= "incident_created" ​&& ​(source.u_number != "" ​|| source.u_sys_id != ""​)){ 
- var names = String("​."​);​ +return
-  +}
- 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); +
-Below is the onAfter script that will share out updated tickets after being received.+var qgr = new GlideRecord("​u_psp_queues"​);​ 
 +var queue = "";​ 
 +qgr.addQuery("​u_name",​ "​"​);​ 
 +if (!{ 
-<​code>​ +queue = qgr.sys_id;​ 
-(function runTransformScript(source,​ map, log, target /*undefined onStart*/ ) { +var qc = new GlideRecord("​psp_replicate_conf"​);​ 
-  +qc.addQuery("​table_name",​ "​incident"​);​ 
- if(source.u_number != ""​){ +qc.addQuery("​u_target_queue",​ qgr.sys_id);​ 
- return; +qc.query();​ 
-+if (!{ 
-  +return; 
- var qgr = new GlideRecord("​u_psp_queues"​);​ +
- var queue = "";​ + 
- qgr.addQuery("​u_name",​ "​"​);​ +var gr = new GlideRecord("​incident"​);​ 
- qgr.query();​ +gr.addQuery("​sys_id",​ target.sys_id);​ 
- if (!{ +gr.query();​ 
- return; +if ({ 
-+var pspR = new PerspectiumReplicator();​ 
-  +pspR.shareRecord(gr,​ "​incident",​ "​update",​ qc.sys_id, "​cipher=3,​SIAM_provider=salesforce"​); 
- 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 (!{ +
- return; +
-  +
- var gr = new GlideRecord("​incident"​);​ +
- gr.addQuery("​sys_id",​ target.sys_id);​ +
- gr.query();​ +
- if ({ +
- var pspR = new PerspectiumReplicator();​ +
- pspR.shareRecord(gr,​ "​incident",​ "​update",​ qc.sys_id);​ +
- }+
 })(source, map, log, target); })(source, map, log, target);
 </​code>​ </​code>​
 +====== Salesforce-side Configuration Steps ======
-====== ​Salesforce ​Configuration ======+__**NOTE**__**:​** To install and configure Perspectium for Salesforce ​using the Salesforce Lightning UI, see [[http://​​display/​siamintegrations/​Salesforce+SIAM|Salesforce SIAM]].
-===== Custom Case Field =====+==== Steps 6 & 7: Install the Salesforce Package & Configure Your Salesforce Organization ​====
-After [[salesforce_installation|installing ​the Perspectium Salesforce ​Package]] and [[salesforce_dynamic_share_configuration|configuring your Salesforce org]], it is necessary to create a custom field in your case table. This field will store the ServiceNow incident numbers when messages are sent over.+To install ​the Perspectium ​for Salesforce ​package on your Salesforce instance, follow ​[[salesforce_installation|the steps described here]].
-Navigate to "​Setup"​ which will be towards ​the top right of the page+Then, configure your Salesforce Organization by [[salesforce_dynamic_share_configuration|following ​the steps described here]]. 
-{{:salesforce_config_1.png|}}+==== Step 8Create 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.
-At the left side of the page, there is a side bar with a search function at the topType in "​case"​ and there should be a Fields option under "​Cases"​+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**.
-From here, you should now be in the **Case Field** page. Scroll down to the "Case Custom Fields and Relationships"​ section and select "​New"​+3. At the left side of the pagethere 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.
-For step 1, scroll ​towards ​the bottom ​and select the "​Text"​ option" ​and click next+4. On the **Case Field** page, scroll ​down to the **Case Custom Fields ​and Relationships** section ​and click **New**.
-For step 2, input your custom field'​s name into the Field LabelField Name will automatically be generated+5. Select ​the **Text** option. Then, click **Next**.
-For step 3, give visibility permissions to the desired usersIn this example, we will be granting everyone permission to view the custom field.+6Type a name for your custom field under **Field Label**. The **Field Name** for your custom field will then be automatically generated.
-Finallycheck the boxes for "Add Field" for "Case Layout"​ and "Close Case Layout"​ and press save+7. Give viewing permissions to any applicable users. In the example beloweveryone is granted permission to view the custom field.
-===== Queues =====+8. Lastly, check the boxes for **Add Field**, **Case Layout**, and **Close Case Layout**. Then click **Save**.
-Navigate into the [[salesforce_queue_configuration|queues]] tab to create a share queue and a subscribed queue in order to exchange messages with ServiceNow.+^{{:​salesforce_config_7.png?​800|}}^ 
-Just like the ServiceNow share queue, point the Salesforce ​share queue to Step 9: Create ​Salesforce ​Shared and Subscribed Queues ====
-{{:​salesforce_queues_1.png|}}+Next, you will need to create a share queue and a subscribed queue in order to exchange messages with ServiceNow.
-The queue name for the subscribed ​queue should be psp.out.salesforce.**your_instance_number_here**+To create your shared ​queue in Salesforce:​ 
 +  - At the top navigation bar underneath the Perspectium logo, click [[salesforce_queue_configuration|Queues]]. Then, click **New Queue** to create a new queue
 +  - For the **Queue Name** field, type // 
 +  - Select ​**Share** from the **Direction** dropdown. 
 +  - Add your Perspectium MBS credentials in the associated fields. Then, click **Save**.
-====Dynamic Share =====+To create your subscribed queue in Salesforce:​ 
 +  - At the top navigation bar underneath the Perspectium logo, click [[salesforce_queue_configuration|Queues]]. Then, click **New Queue** to create a new queue. 
 +  - For the **Queue Name** field, type //​psp.out.salesforce.**your_servicenow_instance_number_here**//​. 
 +  - Select **Share** from the **Direction** dropdown. 
 +  - Add your Perspectium MBS credentials in the associated fields. Then, click **Save**. 
 +==== Step 10: Create Your Salesforce ​Dynamic Share ====
-A [[salesforce_dynamic_share_configuration|dynamic share]] table is necessary for records to be sent out upon creation, update, or deletion. Proceed to create a dynamic share and follow the examples below.+A [[salesforce_dynamic_share_configuration|dynamic share]] table is necessary for records to be sent out to ServiceNow ​upon creation, update, or deletion. ​
-{{:sfdc_dynamic_share_1.png|}}+To create a Salesforce dynamic share: 
 +  - At the top navigation bar under the Perspectium logo, click **Dynamic Shares**. Then, click **New Dynamic Share** to create a new dynamic share. 
 +  - Type any **Name** for your dynamic share. 
 +  - Select **Case** from the **Table** dropdown. 
 +  - Check the box next to **Active**. 
 +  - 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. 
 +  - For the **Target Queue**, select ****. 
 +  - 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**.
-After saving the dynamic share, be sure to click "Save Trigger"​ afterwards+^{{:​screenshot_salesforcesiam_createdynamicshare.png?​850|}}^ 
-{{:​sfdc_dynamic_share_2.png|}}+===== Other ServiceNow-Salesforce SIAM Integration Topics =====
-===== Inbound and Outbound Messages =====+For more information or to add custom configurations for your ServiceNow-Salesforce SIAM integration,​ choose from one of the topics listed below:
-You can see options for Inbound and Outbound Salesforce ​messages[[salesforce_messages|here]]+  * [[salesforce_messages|Inbound and Outbound Salesforce ​Messages]] 
 +  * [[siam_salesforce_attachments_and_comments ​Salesforce Attachments and Comments ]] 
 +  * [[salesforce_change_job_intervals | Change Salesforce Job Intervals]]
common_incident_to_salesforce.1536603593.txt.gz · Last modified: 2018/09/10 11:19 by timothy.pike