Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
The entry point for a Process - there should be one endpoint per Process. Once connected, messages are guided to the Integration based on the unique combination of authentication user & endpoint.
In native ServiceNow, navigate to System Web Services > Scripted Web Services > Scripted REST APIs. Click Unifi.
Navigate to the Resources Related List.
The Unifi Scripted REST API ships with Message template and Attachment template Resources. Unifi uses these templates and substitutes values from the newly created Process to automatically create the equivalent Scripted REST Resources.
Note: The Default ACLs role [x_snd_eb_integration] will need to be given to your Integration User to access the automatically created REST Resources.
Note: The Process record has been updated with the names of the REST Service, Message method and Attachment method. This will enable the Packager to pick it up so that it will be included in the packaged update set. For more information see the Packager Feature Guide.
We will now continue to configure the Integration.
Follow this guide to configure a bidirectional asynchronous integration to the Incident table. This push-push integration will use Unifi both ends.
Congratulations on your decision to use Unifi, the only integration platform you need for ServiceNow. We are sure you will be more than satisfied with this extremely powerful, versatile and technically capable solution.
We have created this Guide as an aid to customers who are beginning their journey in deploying the Unifi integration platform. This document will guide you through an example of how to configure a bidirectional asynchronous Incident integration, sending and receiving messages via the Scripted REST Service.
This guide is here to help you get up and running as quickly as possible, enabling you to realise the enormous benefits to be gained when using Unifi to configure your integration.
For more technical information on how to use Unifi, please see our technical documentation.
Do not build integrations directly within the Unifi application scope. This can create issues with upgrades and application management.
All of the configuration is carried out in Unifi Integration Designer (our portal interface) - Processes, Integrations, Connections, Messages, Fields & Field Maps are configured manually. The remaining configuration elements (Web Service & Trigger) - which were previously configured in native ServiceNow - are automatically created by Unifi.
Automatic creation of the Trigger (Busines Rule) and Web Service (REST Method) make configuring Integrations even easier and more efficient than ever before.
The Trigger (Business Rule) is automatically created (if one doesn't already exist) when you run 'Build' either on the Integration or Message once your Create Message is configured.
The Web Service (REST Method) is automatically created when the Process is configured.
We have structured this Guide to align with the testing approach. Firstly, we shall configure the main elements which have to be in place for the Integration to work, then we shall move on to build & test each of the scenarios individually. For example, build the CreateIncident Message (along with CreateIncidentReceipt & Response), configure the relevant Fields for those Messages and then test the CreateIncident Message. Then do the same for the UpdateIncident Message (& Receipt) and so on.
We want to include some advice on things to be aware of - either to ensure you do them, or avoid doing them - when building & testing Unifi integrations; in particular and especially if many people are building in one instance at the same time (whether that be a training instance or sub-production instance).
Make sure your Process API name is unique, otherwise use an existing Process.
Make sure your SOAP and/or REST endpoints are also unique.
When setting up a Connection:
Never use your own User as the Inbound User as it will prevent the integration from working.
Always ensure that your Inbound User is NOT used by anyone else for the same Process i.e. if you’re creating a Connection for an Integration on the Incident Process, your Inbound User has to be the only User used by an Integration within that Process.
There is no need for you to manually create a Trigger (Business Rule) on a table to be integrated if one doesn’t exist already. Unifi will automatically create one. If you have more than one, you will make duplicate updates.
There is no need for you to manually create a Web Service. Unifi will automatically create one when the Process is configured.
The prerequisite to configuring Unifi is to have it installed on your instance. As with any other ServiceNow scoped application, Unifi must be purchased via the ServiceNow Store before installation.
We recommend you follow the Setup instructions prior to configuring your Integration.
The first element to configure is the Process, which is the top level configuration element where all Integrations are contained.
The first thing to do when creating a new integration is to assign it to its Process. For instance, a new Incident integration would be created within an Incident Process. If you do not yet have a Process defined, then you will need to create a new Process
From the Unifi Integration Designer Dashboard, click on New Process.
On the 'New Process' modal, the fields to be configured are as follows:
*API Name
The API Name is how we identify which Process we are integrating with. The Scripted SOAP/REST Service will reference the API Name (which is why it is important for this to be a unique reference).
Your 'New Process' modal should look like this:
6) Click Create.
You will be redirected to your Process Dashboard:
Click either the '+' tile or 'New Integration' in preparation to configure the Integration.
When you create a Process, Unifi will automatically create the corresponding Web Service (REST methods) - so there is no need to manually create them.
Before we configure the Integration, let's view the Web Service which Unifi has automatically created.
The Connection allows messages to be sent and received and stores all the authentication details of the Integration specific to a single environment.
Before we configure our Connection, we need to ensure we have a user in the instance to use as the Inbound user for our Integration. To configure our Integration user:
In the native ServiceNow window, navigate to User Administration > Users. Click New.
The fields to be configured for the User record are as follows:
Roles
itil: This role is given to access the table of the bonded record.
x_snd_eb_integration: This role is given to access the automatically created Web Service.
Your User record should look like this:
You can set up many connections to enable switching between environments (one connection per environment). However, only one connection can be active for an Integration at a time.
Remember: When setting up a Connection:
Make sure your SOAP and/or REST endpoints are unique.
Never use your own User as the Inbound User as it will prevent the integration from working.
Always ensure that your Inbound User is NOT used by anyone else for the same Process i.e. if you’re creating a Connection for an Integration on the Incident Process, your Inbound User has to be the only User used by an Integration within that Process.
We are going to configure a Connection for the Development environment.
Back in the Unifi Integration Designer window, after clicking the 'Connections' icon, the first thing you will notice is a widget at the top of the page which clearly displays the inbound endpoints (REST Resources) which were automatically created when the Process was configured.
Clicking the link to the right of the Endpoint URL will open the Scripted REST Resource (in native ServiceNow) in a new window.
Click New.
The fields to be configured for the New Connection modal are as follows:
The format of the Endpoint URL is as follows:
https://<your_instance>.service-now.com/<your_resource_path>
The entire Endpoint URL can be easily obtained from the automatically created Message Resource on the Unifi Scripted REST API (displayed in the widget at the top of the Connections page).
For this Development environment Connection, we will set the Endpoint URL to point to our own instance and use the same Integration User for both Inbound and Outbound (as created above). Being able to connect to our own instance makes it simple and efficient to test our integration (seeing Transactions going out and coming in) before we connect to the external system.
Your New Connection modal should look like this:
9) Click Submit and view.
Clicking 'Submit' will redirect you to the list view of the record you're creating. Clicking 'Submit and view' will redirect you to the newly created record.
The fields to be configured for the Details form are as follows:
Your Details form should look like this:
Feature Alert: The widget at the bottom of the page now shows the Integration as Active.
14) Save the Connection.
At this stage you can carry our a basic connection test which verifies whether the user is authorized (i.e. whether you've configured the user/password/roles correctly). To do this, click Connection Test.
Then, on the Connection Test modal, click Test.
The results (Pass/Fail) will be displayed.
Click Done.
The main, manually configured elements are now in place for our Integration to work. We are now ready to configure and test each of our Scenarios in turn.
Remember: There is no need to manually configure a Trigger (Business Rule) on the Process table being integrated as Unifi will automatically create one for us (if one doesn't already exist).
The CreateIncidentReceipt Message is the asynchronous receipt that is sent after processing the Createincident Message.
You will have been redirected to the Messages page after submitting the Response Message. If navigating from elsewhere, click the 'Messages' icon and you will see the following screen (note: the previously configured message is visible in the list):
1) Click New.
The fields to be configured for the CreateIncidentReceipt New Message modal are as follows:
Your CreateIncidentReceipt New Message modal should look like this:
5) Submit and view to further configure the Message.
Navigate to Message > Response.
The Response fields to be configured are as follows:
Your Response form should look like this:
7) Navigate to Message > Bond.
The Bond fields to be configured are as follows:
*Set bond state choices: None, Pending, Open, Suspended, Vendor suspended, Closed
Your Bond form should look like this:
9) Navigate to Inbound > Settings.
The Inbound Settings fields to be configured are as follows:
The code in the 'Reference lookup script' field should look like this:
Reference lookup script: In an asynchronous integration it's important to identify which message an asynchronous receipt is replying to. This script extracts the transaction's unique identifier.
In the case of an inbound create/update it would return their external message id (source id) to identify which transaction our asynchronous receipt belongs to. In the case of an inbound asynchronous receipt it would return our internal message id (target id) to identify which transaction their asynchronous receipt belongs to.
Your Inbound Settings form should look like this:
11) Click 'Save'.
We are now ready to configure the Fields for our CreateIncidentReceipt Message.
#
Field
Description
Value
1
Name
The name of the ServiceNow process being integrated.
<SN Process Name> (e.g. Incident)
2
API Name*
The unique name of this process for use with the API.
<your_unique_api>
3
Target table
The primary target or process table that this integration uses.
'Incident' [incident]
4
Reference field
The field on the target table that is used as the reference for the external system.
'Number'
5
Description
Describe what this Process is for.
<Your description>
#
Field
Description
Value
6
Environment
The environment this connection applies to.
'Development'
7
Endpoint URL
The external system's access URL.
<External system Endpoint URL>
8
Active
Use this connection for the integration when true.
<true>
#
Field
Description
Value
10
Authentication
The authentication method to use for this connection.
'Basic'
11
User
The username used in basic authentication.
<external.system.user>
12
Password
The password used in basic authentication.
<External system user password>
13
Inbound user
The user profile used by the external system for authentication. An active connection must be found for the user to gain access.
<lookup: Your Inbound User>
#
Field
Description
Value
2
Message name
The message name that is unique for this integration.
'CreateIncidentReceipt'
3
Type
The primary purpose of the message.
'Receipt'
4
Direction
The direction(s) this message is configured to support. (Choices: Inbound, Outbound, Bidirectional)
'Bidirectional'
#
Field
Description
Value
6
Response
The immediate synchronous response to this message.
<lookup: 'Response'>
#
Field
Description
Value
8
Set bond state inbound*
Set the Bond State when receiving this message. Use 'None' to leave the Bond State alone or to modify it via a Message/Field Stage to Target script.
'Open'
#
Field
Description
Value
10
Reference lookup script
The script containing functions for extracting internal and external references from the request payload.
Update the code in the Reference lookup script field so that it looks like the code below
#
Field
Description
Value
1
User ID
The id of the user (to be used by the external system for authentication).
<your.integration_user>
2
First name
The integration user's first name.
<Your First Name>
3
Last name
The integration user's last name.
<Your Last Name>
4
Password
The user's password (to be used in basic authentication).
<Your Password>
5
Roles
The roles required for access to the integrated records.
'itil', 'x_snd_eb_integration'
The Response Message is the immediate synchronous response that is sent to acknowledge the successful transport of another Message.
In Unifi Integration Designer, click on the 'Messages' icon & then New to begin configuring the Response Message.
The fields to be configured for the New Message modal are as follows:
Your Response New Message modal should look like this:
4) Click Submit.
You will be redirected to the Messages page. We need not configure our Response Message any further.
Next, we shall move on and configure the CreateIncidentReceipt Message.
For each of our Scenarios we will need to configure the relevant Messages & Fields. This scenario will need to be tested before moving on to the next.
The Messages we shall be configuring for our Create Scenario are:
Response
CreateIncidentReceipt
CreateIncident
We will define which Field records require configuring for each of those Messages at the appropriate time.
The scenario will need to be successfully tested before we can say it is complete.
We shall look in detail at each of the Messages and their respective Fields in turn over the next few pages, before moving on to Test.
This Guide utilises the Unifi Integration Designer portal interface which allows you to configure and manage integrations much more intuitively and with greater efficiency.
From within native ServiceNow, open the Unifi Integration Designer portal by navigating to Unifi > Unifi Integration Designer.
You will be greeted with the following Dashboard (which opens in a new window):
Any existing Processes will be listed as tiles, showing the number of Active Integrations for each. The total number of Active Integrations is also shown on the Dashboard.
Hovering over the tile of an existing Process will display 'Show integrations'. Clicking it will take you to the Integrations page (for that Process).
If appropriate, you can either edit the Settings of, or add a New Integration to an existing Process by clicking the ellipsis (at the bottom right of the tile).
In the next section, we shall look at configuring a new Process.
This is what defines the connection between a Process and the single system it's connecting with. It is also where most of the configuration and settings are stored.
Back in the Unifi Integration Designer window, after clicking either on the '+' tile or 'New Integration', you are given a 'New Integration' modal to complete.
The fields to be configured for the New Integration modal are as follows:
*Service type/Message format: these values are defaulted.
Your 'New Integration' modal should look like this:
2) Click Create.
You will be redirected to the Details page of the newly created Integration.
Before continuing we would like to draw your attention to some of the relevant icons that are now visible down the left hand navigation strip.
The icons are:
a) 'Integration' icon: Opens the current integration's Details page.
b) 'Messages' icon: Opens the current integration's Messages page.
c) 'Fields' icon: Opens the current integration's Fields page.
d) 'Field Maps' icon: Opens the current integration's Field Maps page.
e) 'Documentation' icon: Opens the automatically generated documentation for the current integration. (Another awesome feature in Unifi.)
f) 'Connections' icon: Opens the current integration's Connections page.
The Details page of your Integration should look like this:
3) Navigate to Integration > Message Identification.
Unifi needs to identify the name of the inbound message in order to know how to process the inbound data.
4) Update the code in the 'Identify message script' field so that it looks like this:
The Message Identification form should look like this:
5) Navigate to Settings > Feedback.
The Feedback fields to be configured for the Integration record are as follows:
The Feedback Settings form should look like this:
All of the remaining 'Settings' values are to be left as-is:
Attachments Settings
Bond Settings
All of the 'Error handling' values are to be left as-is:
General
Timeouts
Retry
7) Click Save.
8) Click the 'Connections' icon to move on and configure the Connection.
The CreateIncident Message will create a ticket on the target table of the integrated system.
As previous, after clicking the 'Messages' icon, you will see the following screen (note: both the previously configured messages are now visible in the list):
1) Click New.
The fields to be configured for the CreateIncident New Message modal are as follows:
Your CreateIncident New Message modal should look like this:
5) Submit and view to further configure the Message.
Navigate to Message > Response.
The Response fields to be configured are as follows:
*This field is automatically defaulted to true.
Your Response form should look like this:
8) Navigate to Message > Bond.
The Bond fields to be configured are as follows:
*These fields are automatically populated.
Your Bond form should look like this:
11) Navigate to Outbound > Trigger.
The Outbound Trigger fields to be configured (as required)* are as follows:
*Outbound condition (as required):
It is not necessary for you to enter a condition. The value given is an example. You may create any condition (or not) to align with your business process requirements.
The code in the 'Outbound condition' script field should look like this:
This is an example of data-driving the trigger condition. This script checks whether the integration that this message belongs to is listed in a custom field on the assignment group which references the integration.
Your Outbound Trigger form should look like this:
13) Navigate to Outbound > Settings.
The Outbound Settings fields to be configured are as follows:
Your Outbound Settings form should look like this:
15) Navigate to Inbound > Settings.
The Inbound Settings fields to be configured are as follows:
*This field is automatically populated & not editable.
Bond reference method:
Internal - lookup using the internal reference only.
External - lookup using the external reference only.
Both - lookup using both the internal and external references.
Bond reference method: The perspective of the available choices is in relation to the receiving instance i.e. Internal (internal reference) means the bonded ticket in our instance and External (external reference) means the bonded ticket in their instance.
Primarily used in relation to create and update type messages, these settings define which values to lookup against to search for and validate whether or not a bond already exists.
In the case of a create type message, we use 'External' because there is not yet a bonded ticket in the receiving instance to reference (if we were to receive a create type message which referenced a bond that already existed it would be rejected because we don't want to create another bond for a record we've already seen ).
In the case of an update type message, we use 'Both' because it's a more accurate method of validating updates are being sent to/received from the correct bonded records.
The code in the 'Reference lookup script' field should look like this:
Your Inbound Settings form should look like this:
17) Click Save.
We are now ready to configure the Fields for our CreateIncident Message.
We will utilise the Field & Field Map records to configure the Message Scripts for the CreateIncidentReceipt Message.
It is worth copying all relevant OOTB Field Maps as are necessary for your integration before using any of them in your Field Records - thereby mitigating the risk of any potential issues with future upgrades.
The Field Maps we shall use for our CreateIncidentReceipt Field records are:
Message Header
Receipt Status
To copy the Message Header Field Map, navigate to the 'Field Maps' icon.
1) Click on the ellipsis to the right of the Message Header Field Map & then click Copy.
The fields to edit for the Copy Field Map modal are as follows:
*This field is automatically populated.
*Name: We have chosen to prefix the existing Field Map Name with the initials of our Integration (you are free to choose any appropriate means of identifying/differentiating).
Your Copy Field Map modal should look like this:
3) Click Copy.
You will be redirected to the Details page of the newly created Field Map.
Repeat the process for the Receipt Status Field Map.
From the CreateIncidentReceipt Message, navigate to Message > Fields. Click New.
The fields to be configured for our message_header New Field modal are as follows:
*These fields are automatically defaulted to true, or automatically populated.
**Field map: Value may vary. Choose the copy Field Map you created for your Integration.
Your 'message_header' New Field modal should look like this:
9) Submit the record.
You will be redirected back to the Fields page of the CreateIncidentReceipt Message.
Click New.
The fields to be configured for our transaction_details New Field modal are as follows:
*These fields are automatically defaulted to true, or automatically populated.
**Field map: Value may vary. Choose the copy Field Map you created for your Integration.
Your 'transaction_details' New Field modal should look like this:
15) Submit the record.
You will be redirected back to the Fields page of the CreateIncidentReceipt Message.
Now that we’ve configured the Field records for the CreateIncidentReceipt message, we are ready to build our message scripts.
The following Field records should now be in place for your CreateIncidentReceipt messsage:
Feature Alert: In the picture above you will notice that a 'Build Integration' button has appeared in the banner at the top of the page. Whenever a change is made to a Field record that is associated to a Message (whether that is being created, updated, or deleted) the button will be available and acts as a visual reminder that changes have been made and Message Script(s) need to be built. We will talk more about this feature in the Build Integration Level page.
16) Navigate to Advanced > Script Editor.
When you first open the Script Editor, you will see the following:
Having visibility of your message scripts in the one pane makes scripting so much more efficient.
17) Click on Build Message.
You will see the 'Message build successful' Info Message.
Your Script Editor fields should now look like this:
You can click View to adjust the layout and change the view to show various combinations of, or individual script fields.
The newly auto-generated code will appear between a Begin & End Comment immediately prior to any code that may already be there (pre-existing code will be retained).
Once you have finished examining the code, click 'Close' to navigate back to the Fields page of the CreateIncidentReceipt Message.
We are now ready to configure our CreateIncident Message.
We will utilise the Field & Field Map records to configure the Message Scripts for the CreateIncident Message.
The ‘message.message_header’ Field record is visible and inactive. It is an Integration level Field which was automatically created by Unifi at the time we created the Message level record (as per the 'CreateIncidentReceipt Fields' page). We’ll talk more about Integration level & Message level Fields in the 'Field: incident.state' section.
It is now easier than ever to create a Message level Field record for its Integration level counterpart.
From the CreateIncident Message, navigate to Message > Fields.
1) Find the message.message_header (Integration level) Field & set Active to true.
Feature Alert: The ‘Build Integration’ button becomes visible in the banner and the empty 'circle icon' (next to the Field name) turns green & contains a green ‘check’ (to indicate that Message level configuration exists for this Field). Note: the empty 'circle icon' indicates that the Integration level Field is available to add to the Message.
By simply setting the Active flag to true on the Integration level Field record listed on the Message, Unifi has automatically created the Message level counterpart. The Integration level record still exists (and can be seen when you click on the ‘Fields’ icon to navigate to the Fields page), but is no longer visible in the list view on the Message because the Message level record has been created.)
Hints & Tips: Unifi automatically creates Integration level Fields when we first create the Message level equivalent records; those Integration level Fields are visible on the Fields list of the Messages we subsequently create. Therefore, if a Field is required for multiple Messages, create it once for the first Message and then simply set active to true for its Integration level counterpart from the Fields list of each of the relevant Messages that Field is required on.
We will now configure Field records for a select few Incident record field elements.
Depending on your requirements, you will need to create Field records for each of the relevant Incident record field elements (see the table below for an example). For the sake of brevity, this Guide will focus on a select few. If you wish, however, you are free to continue & configure the remaining Field records. The table below lists an example of the Incident record field elements you may wish to map and the relevant Field Maps required to configure each Field record. For a fuller definition of available Field Maps, please see the relevant page in our technical documentation.
The Field records we will focus on will be for Caller (Reference), Short description (String) and State (Choice).
If you haven't already, you will need to copy the relevant additional Field Maps for the CreateIncident Field records as follows:
Reference
String
Choice
See Copy Field Maps (on the 'CreateIncidentReceipt Fields' page) for details.
From the CreateIncident Message, navigate to Message > Fields. Click New.
The fields to be configured for the incident.caller_id New Field modal are as follows:
*These fields are automatically defaulted to true, or automatically populated.
**Field map: Value may vary. Choose the copy Field Map you created for your Integration.
Your 'incident.caller_id' New Field modal should look like this:
6) Submit the record.
You will be redirected back to the Fields page of the CreateIncident Message.
Click New.
The fields to be configured for the incident.short_description New Field modal are as follows:
*These fields are automatically defaulted to true, or automatically populated.
**Field map: Value may vary. Choose the copy Field Map you created for your Integration.
Your 'incident.short_description' New Field modal should look like this:
11) Submit the record.
You will be redirected back to the Fields page of the CreateIncident Message.
Field records can exist at both the Integration and the Message level (a Field record exists at the Integration level if it isn't linked to a Message i.e. the 'Message' field element is left blank). We noted previously that an Integration level Field record is automatically created when we first create one at the Message level. We will utilise and configure both when mapping 'incident.state'.
The 'incident.state' Field record is a Choice 'type' Field. These are used when you’re mapping choice field elements with static values that don't change per Message (e.g. State, Impact, Urgency) i.e. you're not going to have one set of choices/values for create and another for update.
Rather than configure choices for each Message, configure choices once at the Integration level. This means you only need define them once. The Field Map will take care of it and any 'incident.state' Field records that are set at the Message level (i.e. with a value in the 'Message' field) would use the choices configured at the Integration level.
We'll first configure the Message level Field and then move on to configure the choices on its Integration level counterpart.
There is no need to 'Generate field choices' for Message level Field records because the Field Map always looks for them on an Integration level Field which has the same name.
From the CreatIncident Message, navigate to Message > Fields. Click New.
The fields to be configured for our incident.state (Message level) New Field modal are as follows:
*These fields are automatically defaulted to true, or automatically populated.
**Field map: Value may vary. Choose the copy Field Map you created for your Integration.
Your 'incident.state' (Message level) New Field modal should look like this:
16) Submit the record.
You will be redirected back to the Fields page of the CreateIncident Message.
We will need to 'Generate field choices' for this Integration level Choice 'type' Field.
Navigate to the 'Fields' icon to open the Fields page.
17) Click to open the incident.state (Integration level) Field record (the one where Message is empty).
The incident.state Field record opens to the Details page.
18) Navigate to Field > Field Choices.
19) Click Generate field choices.
20) Click Generate on the 'Generate field choices' modal which displays.
The Field Choices are generated & now visible in the list.
At this stage, you could carry on and configure any remaining Field records for the rest of the Incident record field elements (as per your requirements - see the Fields & Field Maps table at the top of this section). However, we will now run the Build process to auto-generate our Message Scripts.
Now that we’ve configured the Field records for the CreateIncident message, we are ready to build our message scripts.
From the CreateIncident message, navigate to Message > Fields.
The following Field records should now be in place for your CreateIncident messsage:
21) Click on Build Message.
You will see the 'Message build successful' Info Message.
22) Navigate to Advanced > Script Editor to view the auto-generated code.
Your Script Editor fields should look like this:
The newly auto-generated code will appear between a Begin & End Comment immediately prior to any code that may already be there (pre-existing code will be retained).
We are now ready to Test our CreateIncident Message.
Before we do, let's view the Trigger which Unifi automatically created when we ran 'Build Message'.
Follow these steps to test the CreateIncident Message.
Because we have configured Unifi to connect to itself, we don't need to wait until we've connected to the external system before we test. We can test both sending and receiving Messages in the one instance. It goes without saying that these tests should be repeated once we have connected to the external instance.
To test, we will create an incident in our instance and then follow the data as it flows through the Unifi transport stack and on to the newly created ticket (whether that be in our instance, or in the external system we are integrating with).
We have data-driven the trigger for our Create Message so that it fires when a ticket is assigned to an assignment group which has the integration referenced on it. In order to test then, we’ll need to add our integration to the Unifi Integrations field on the assignment group that triggers our incidents. We will create a new assignment group as an example.
In native ServiceNow, navigate to User Administration > Groups. Click New.
The Group fields to be configured are as follows:
*Unifi Integrations: This field may need to be created/added to the Group [sys_user_group] record.
Your Group record should look like this:
4) Submit.
In native ServiceNow, navigate to Incident > Create New.
The Incident fields to configure are as follows:
*Note: We have chosen these fields as these were the ones we mapped when creating our Field records for the CreateIncident Message. Your choices may differ depending on which Field records you created.
Your Incident form should look like this:
8) Right-click & Save.
Note the values entered (including State), so that you can check them against the mapped fields on the corresponding record in the instance being integrated to.
You should see an Info Message, confirming the CreateIncident Message is being sent to your Integration:
When you scroll down to the 'Unifi Integrations' related list (you may have to configure the related lists to add it to your Incident form), notice:
9) A Bond has been created. The External reference is populated & the State has changed to 'Open'. Click the Bond Number link to open the Bond record.
Note: You may need to refresh the list by clicking the Bonds breadcrumb to view the changes.
Your Bond record should look like this:
10) Bond details:
Integration: < Your Integration >
Connection: < Your Connection >
Table: 'Incident [incident]'
Document: < Your Incident >
State: 'Open' (Message exchange is available)
Status: 'OK' (All transactions have completed)
Internal reference: < ServiceNow ticket reference > (Same as 'Document')
External reference: < External system's ticket reference >
11) Transaction:
Message ID: Internal system's unique Transaction identifier
External Message ID: External system's unique Transaction identifier
Message: 'Createincident'
Direction: 'Outbound'
Transaction state: 'Complete' (The data has been successfully transported)
Process state: 'Accepted' (The transaction was accepted as within the scope of the business logic that's in place)
You are able to view the logs in the 'Unifi Activity Logs' related list.
12) Transaction process next queued: Logs from checking whether there are any other transactions queued and processing those.
13) Transaction receive message: Logs from processing the inbound asynchronous receipt.
14) Transaction sending: Logs from taking the Stage data, building the Request record & sending the Request to the integrated system.
15) Business rule: < Your Trigger >: Logs from the Business Rule that triggered Unifi.
Click through to the Transaction record from the related list on the Bond.
Your Transaction record should look like this:
16) Transaction details:
Table: 'Incident [incident]'
Document: < Your Incident >
Integration: < Your Integration >
Connection: < Your Connection >
Bond: < Your Bond >
Message: 'CreateIncident'
Direction: 'Outbound'
Transaction state: 'Complete' (The data has been successfully transported)
Process state: 'Accepted' (The transaction was accepted as within the scope of the business logic that's in place)
17) Errors:
Error: (If there was a transactional error the Transaction state would show as 'Error' and the details would be captured here).
Process error: (If there was a process error the Process state would show as 'Rejected' and the details would be captured here)
18) Stages:
Direction: 'Outbound' & 'Inbound'
Message: 'CreateIncident' & 'CreateIncidentReceipt'
Internal reference: < ServiceNow ticket reference > (Same as 'Document')
External reference: < External system's ticket reference >
Click through to the Outbound Stage record from the related list on the Transaction. (If you wish, you could also do the same for the Inbound Stage record.)
Check the values in the fields match what you expect.
Your Stage record should look like this:
19) Stage details:
Direction: 'Outbound'
Internal reference: < ServiceNow ticket reference >
Snapshot: < Snapshot record reference >
Message: 'CreateIncident'
Transaction: < Your Transaction >
Integration: < Your Integration >
20) Mapped Staged Data fields (yours may differ depending on which Field records you created):
caller_id: < Your caller.id >
short_description: < Your Short description >
state: '1'
Click through to the outbound HTTP Request record from the related list on the Transaction. (If you wish, you could also do the same for the Inbound HTTP Request.)
This is where you will find details of the data that was transported between the systems being integrated. (These records are extremely useful for developing and debugging integrations because of the immediate availability and contextual relevance to the integration you are developing.)
Your HTTP Request record should look like this:
21) HTTP Request details:
Integration: < Your Integration >
Connection: < Your Connection >
Transaction: < Your Transaction >
Message: 'CreateIncident'
Direction: 'Outbound'
Request state: 'OK' (There are no errors with the HTTP Request.)
Attempt number: < Number of HTTP Request attempts > (Failed requests are retried up to the maximum attempts number as configured on the Integration.)
Endpoint URL: < The external system’s access URL >
Action Method: 'POST'
Request headers: < The header of the request being sent >
Request payload: < The payload of the request being sent >
22) Response details:
Status code: '200'
Response headers: < The header of the response being received >
Response payload: < The payload of the response being received >
Navigate to the corresponding Incident in the external system.
Check the values in the fields match those you noted when you saved the Incident in the internal system.
Your external system's Incident record should look like this (depending on the system you're integrating with, your record may look different; the important matter is that the values match):
23) Caller: < Your Caller >
24) State: < Your State >
25) Short description: < Your Short description >
26) Activities: < Note showing activity on the Incident > (Opened by < your.external.system.user > configured in the Connection)
27) Bond: Note that a bond exists in the external system in an 'Open' state and the 'Internal reference' & 'External reference' are reversed
If completing this test after having integrated with the external system (as opposed to connecting to your own instance), it would be good to test the CreateIncident Message in both directions.
We are now ready to move to the Update Scenario.
For each of our Scenarios we will need to configure the relevant Messages & Fields. This scenario will need to be tested before moving on to the next.
The Messages we shall be configuring for our Update Scenario are:
Receipt
UpdateIncident
We will define which Field records require configuring for each of those Messages at the appropriate time.
The scenario will need to be successfully tested before we can say it is complete.
We shall look in detail at each of the Messages and their respective Fields in turn over the next few pages, before moving on to Test.
The Receipt Message is the asynchronous receipt that is sent after processing update type messages.
Again, after clicking the 'Messages' icon, you are directed to the following screen (note: the three previously configured messages are now visible in the list):
1) Click on the ellipsis to the right of the CreateIncidentReceipt Message & click Copy.
Rather than create the Receipt Message from scratch, it will be quicker to copy the CreateIncidentReceipt Message and make one minor change.
The fields to edit for the Copy Message modal are as follows:
Your Copy Message modal should look like this:
3) Click Copy.
You will be redirected to the Details page of the newly created Receipt Message.
Navigate to Message > Bond.
The Bond fields to be edited are as follows:
*Set bond state choices: None, Pending, Open, Suspended, Vendor suspended, Closed
Your Bond form should look like this:
5) Click Save.
6) Click Build Message.
You will see the 'Message build successful' Info Message.
7) Click the 'Messages' icon to move on & configure the UpdateIncident Message.
There is no further configuration required for the Receipt Message.
The UpdateIncident Message is an update type message that sends updates to the bonded record.
Again, after clicking the 'Messages' icon, you are directed to the following screen (note: the four previously configured messages are now visible in the list):
1) Click New.
The fields to be configured for the UpdateIncident New Message modal are as follows:
Your UpdateIncident New Message modal should look like this:
5) Submit and view to further configure the Message.
Navigate to Message > Response.
The Response fields to be configured are as follows:
*This field is automatically defaulted to true.
Your Response form should look like this:
8) Navigate to Message > Bond.
The Bond fields to be configured are as follows:
*These fields are automatically populated.
Your Bond form should look like this:
11) Navigate to Outbound > Trigger.
The Outbound Trigger fields to be configured (as required)* are as follows:
*Outbound condition (as required):
It is not necessary for you to enter a condition. The value given is an example. You may create any condition (or not) to align with your business process requirements. In this case it makes sense to use this message to send an update where the state doesn't change. Typically, we would configure different messages to align with state changes (e.g. Close, Resolve).
The code in the 'Outbound condition' script field should look like this:
Your Outbound Trigger form should look like this:
13) Navigate to Inbound > Settings.
The Inbound Settings fields to be configured are as follows:
*Bond reference method:
Internal - lookup using the internal reference only.
External - lookup using the external reference only.
Both - lookup using both the internal and external references.
As mentioned earlier, because this is an update type message, we use 'Both' as it's a more accurate method of validating updates are being sent to/received from the correct bonded records.
The code in the 'Reference lookup script' field should look like this:
Your Inbound Settings form should look like this:
16) Click Save.
We are now ready to configure the Fields for our UpdateIncident Message.
The Trigger is a Business Rule which stipulates the conditions under which Messages will be sent for the Process concerned.
There is no need for you to manually create a Trigger (Business Rule). If you have more than one, you will make duplicate updates.
Unifi will automatically create a Trigger (Business Rule) for the Process being integrated (if one doesn't already exist) when you run 'Build' either on the Integration or Message once your Create Message is configured.
In native ServiceNow, navigate to System Definition > Busines Rules. Find and navigate to the automatically generated Business Rule.
The format of the name will be '[S] Unifi ' + <Table Name> + ' trigger rule'.
The top section of your Business Rule record should look like this:
Your 'When to run' tab should look like this:
The code in the script field should look like this:
Your 'Advanced' tab should look like this:
We have confirmed the main elements are in place for our Integration to work. We are now ready to Test our CreateIncident Message.
We will utilise the Field & Field Map records to configure the Message Scripts for the UpdateIncident Message.
The 'message_header' (Integration level) Field record should already be in place (i.e. with Active set to false). We will now create its Message level counterpart.
From the UpdateIncident Message, navigate to Message > Fields.
Your UpdateIncident Fields page should look like this:
1) Find the message.message_header (Integration level) Field & set Active to true.
The 'Build Integration' button becomes visible in the banner and the empty circle icon next to the Field name turns green & contains a green 'check' (to indicate that Message level configuration exists for this Field). Note: the empty 'circle icon' indicates that the Integration level Field is available to add to the Message.
As before, by setting the Active flag to true on the Integration level Field record listed on the Message, Unifi has automatically created the Message level counterpart.
Next, repeat the process for the incident.short_description Field.
The 'incident.short_desccription' (Integration level) Field record should already be in place (i.e. with Active set to false). We will now create its Message level counterpart.
Your UpdateIncident Fields page should look like this:
2) Find the incident.short_description (Integration level) Field & set Active to true.
The empty circle icon next to the Field name turns green & contains a green 'check' (to indicate that Message level configuration exists for this Field).
We will now configure Field records for two other Incident record field elements.
The table below lists the Incident record field elements we will map and the relevant Field Maps required to configure each Field record.
If you haven't already, you will need to copy the relevant additional Field Maps for the UpdateIncident Field records as follows:
Journal field
From the UpdateIncident Message, navigaate to Message > Fields & click New.
The fields to be configured for our incident.comments New Field modal are as follows:
*These fields are automatically defaulted to true, or automatically populated.
**Field map: Value may vary. Choose the copy Field Map you created for your Integration.
Your 'incident.comments' New Field modal should look like this:
7) Submit the record.
You will be redirected back to the Fields page of the UpdateIncident Message.
Because the incident.work_notes Field record is the same 'type' (IG Journal field) & the majority of the settings are the same as the previously configured Field, it will be quicker to copy the incident.comments Field & make a few minor changes.
8) Click the ellipsis next to the incident.comments Field record & click Copy.
The fields to edit for the Copy Field modal are as follows:
*This field is automatically populated.
Your Copy Field modal should look like this:
11) Click Copy.
You will be redirected to the Details page of the newly created incident.work_notes Field record.
Now that we’ve configured the Field records for the UpdateIncident message, we are ready to build our message scripts.
To quickly navigate to the UpdateIncident Message from the Details page of the newly created incident.work_notes Field record…
...click the 'Preview' icon to the left of the Message field.
From the UpdateIncident message, navigate to Message > Fields.
The following Field records should now be in place for your UpdateIncident messsage:
12) Click on Build Message.
You will see the 'Message build successful' Info Message.
13) Navigate to Advanced > Script Editor to view the auto-generated code.
Your Script Editor fields should look like this:
The newly auto-generated code will appear between a Begin & End Comment immediately prior to any code that may already be there (pre-existing code will be retained).
We are now ready to Test our UpdateIncident Message.
As with the CreateIncident Message and depending on your requirements, you will need to create Field records for each of the relevant Incident record field elements (see the table in on the 'CreateIncident Fields' page for an example). For the sake of brevity, this Guide will focus on two of those. If you wish, however, you are free to configure other Field records as required.
See (on the 'CreateIncidentReceipt Fields' page) for details.
#
Field
Description
Value
6
Enable UI messages
Allow information and error messages to be shown to the user as UI Notifications. Only applies to certain notifications.
<true>
#
Field
Description
Value
2
Message name
The message name that is unique for this integration.
'CreateIncident'
3
Type
The primary purpose of the message.
'Create'
4
Direction
The direction(s) this message is configured to support.
'Bidirectional'
#
Field
Description
Value
6
Response
The immediate synchronous response to this message.
<lookup: 'Response'>
*
Async
Turn this option on if you want inbound processing to occur asynchronously or this message is the first of an asyncronous message pair.
<true>
7
Async receipt
The asynchronous receipt to this message.
<lookup: 'CreateIncidentReceipt'>
#
Field
Description
Value
*
Bond ownership
Determine if the sender should own the bond or not in order for this message to be processed? Use 'Ignore' to process regardless of the owner flag. (Choices: Ignore, Must own, Must not own.)
'Ignore'
*
Bond condition type
The type of conditional check made on the bond. (None: no checks are made. State: checks against the state are made using the conditional checkboxes. Scripted: the 'Bond condition' script is used.)
'State'
9
Bond new
Process this message when a new bond is required.
<true>
10
Set bond state inbound
Set the Bond State when receiving this message. Use 'None' to leave the Bond State alone or to modify it via a Message/Field Stage to Target script. (Choices: None, Pending, Open, Suspended, Vendor suspended, Closed)
'Open'
#
Field
Description
Value
12
Outbound condition*
The condition that the ServiceNow record must meet to trigger this message being processed.
Update the Outbound condition script field with the code below
#
Field
Description
Value
14
Action method
The SOAP Action or the REST Method to use for this message. If this field is empty the SOAP Action will default to the message name and the REST Method will default to POST.
'POST'
#
Field
Description
Value
*
Bond reference method
Method of searching for and validating an existing bond for incoming messages.
'External'
16
Reference lookup script
The script containing functions for extracting internal and external references from the request payload.
Update the code in the Reference lookup script field so that it looks like the code below
#
Field
Description
Value
2
Name*
The name of your field map. (If left unedited, it will append the word 'Copy' to the existing name.)
<Your Name>
*
Integration
The integration this field map is associated with.
<Your Integration>
#
Field
Description
Value
*
Message
The Message this Field record is linked with.
'CreateIncidentReceipt'
4
Description
Describe what this field is for and any specific details that might help you in future.
'The protocol message header'
*
Active
Set to true to use this Field record for processing.
<true>
5
Field map
The Field Map this Field record is linked with.
'IG - Message Header'**
6*
Map to field
Use this Field record to represent a field on a source/target table.
<false>
7
Path
Where in the payload the data will be placed.
'message'
8
Property
The property in the payload the data will be written to.
'message_header'
*
Inbound
Set to true to use for inbound Messages.
<true>
*
Outbound
Set to true to use for outbound Messages.
<true>
#
Field
Description
Value
*
Message
The Message this Field record is linked with.
(automatically populated)
10
Description
Describe what this field is for and any specific details that might help you in future.
'Used to send and receive transaction process errors'
*
Active
Set to true to use this Field record for processing.
<true>
11
Field map
The Field Map this Field record is linked with.
'IG - Receipt Status'**
12*
Map to field
Use this Field record to represent a field on a source/target table.
<false>
13
Path
Where in the payload the data will be placed.
'message'
14
Property
The property in the payload the data will be written to.
'transaction_details'
*
Inbound
Set to true to use for inbound Messages.
<true>
*
Outbound
Set to true to use for outbound Messages.
<true>
Incident Field
Field Map
caller_id
Reference
short_description
String
description
String
category
Choice
impact
Choice
urgency
Choice
state
Choice
comments
Journal field
work_notes
Journal field
#
Field
Description
Value
*
Message
The Message this Field record is linked with.
'CreateIncident'
2
Description
Describe what this field is for and any specific details that might help you in future.
'The caller on this incident'
*
Active
Set to true to use this Field record for processing.
<true>
3
Field map
The Field Map this Field record is linked with.
'IG - Reference'**
*
Map to field
Use this Field record to represent a field on a source/target table.
<true>
*
Table
The primary source/target table that this Field record is mapped to.
'Incident' [incident]
4
Element
The field on the source/target table this Field record is mapped to.
'Caller'
5
Path
Where in the payload the data will be placed.
'detail'
*
Property
The property in the payload the data will be written to.
Automatically populated
*
Inbound
Set to true to use for inbound Messages.
<true>
*
Outbound
Set to true to use for outbound Messages.
<true>
#
Field
Description
Value
*
Message
The Message this Field record is linked with.
'CreateIncident'
7
Description
Describe what this field is for and any specific details that might help you in future.
'The short description of the incident'
*
Active
Set to true to use this Field record for processing.
<true>
8
Field map
The Field Map this Field record is linked with.
'IG - String'**
*
Map to field
Use this Field record to represent a field on a source/target table.
<true>
*
Table
The primary source/target table that this Field record is mapped to.
'Incident' [incident]
9
Element
The field on the source/target table this Field record is mapped to.
'Short description'
10
Path
Where in the payload the data will be placed.
'detail'
*
Property
The property in the payload the data will be written to.
Automatically populated
*
Inbound
Set to true to use for inbound Messages.
<true>
*
Outbound
Set to true to use for outbound Messages.
<true>
#
Field
Description
Value
*
Message
The Message this Field record is linked with.
'CreateIncident'
12
Description
Describe what this field is for and any specific details that might help you in future.
'The incident lifecycle state'
*
Active
Set to true to use this Field record for processing.
<true>
13
Field map
The Field Map this Field record is linked with.
'IG - Choice'**
*
Map to field
Use this Field record to represent a field on a source/target table.
<true>
*
Table
The primary source/target table that this Field record is mapped to.
'Incident' [incident]
14
Element
The field on the source/target table this Field record is mapped to.
'State'
15
Path
Where in the payload the data will be placed.
'detail'
*
Property
The property in the payload the data will be written to.
Automatically populated
*
Inbound
Set to true to use for inbound Messages.
<true>
*
Outbound
Set to true to use for outbound Messages.
<true>
# | Field | Description | Value |
5* | Caller | Person who reported or is affected by this incident. | <Your Caller> |
* | State | The Incident lifecycle state. | 'New' - Default (Automatically populated) |
6 | Assignment group | The group which triggers the Integration. | <Your Group> |
7* | Short description | A brief description of the incident. | <Your Short description> |
# | Field | Description | Value |
2 | Message name | The message name that is unique for this integration. | 'Receipt' |
# | Field | Description | Value |
4 | Set bond state inbound* | Set the Bond State when receiving this message. Use 'None' to leave the Bond State alone or to modify it via a Message/Field Stage to Target script. | 'None' |
# | Field | Description | Value |
2 | Message name | The message name that is unique for this integration. | 'UpdateIncident' |
3 | Type | The primary purpose of the message. | 'Update' |
4 | Direction | The direction(s) this message is configured to support. | 'Bidirectional' |
# | Field | Description | Value |
6 | Response | The immediate synchronous response to this message. | <lookup: 'Response'> |
* | Async | Turn this option on if you want inbound processing to occur asynchronously or this message is the first of an asynchronous message pair. | <true> |
7 | Async receipt | The asynchronous receipt to this message. | <lookup: 'Receipt'> |
# | Field | Description | Value |
* | Bond ownership | Determine if the sender should own the bond or not in order for this message to be processed? Use 'Ignore' to process regardless of the owner flag. (Choices: Ignore, Must own, Must not own.) | 'Ignore' |
* | Bond condition type | The type of conditional check made on the bond. (None: no checks are made. State: checks against the state are made using the conditional checkboxes. Scripted: the 'Bond condition' script is used.) | 'State' |
9 | Bond pending | Process this message when the bond state is Pending. | <true> |
10 | Bond open | Process this message when the bond state is Open. | <true> |
# | Field | Description | Value |
12 | Outbound condition* | The condition that the ServiceNow record must meet to trigger this message being processed. | Update the Outbound condition script field with the code below |
# | Field | Description | Value |
14 | Bond reference method* | Method of searching for and validating an existing bond for incoming messages. | 'Both' |
15 | Reference lookup script | The script containing functions for extracting internal and external references from the request payload. | Update the code in the Reference lookup script field so that it looks like the code below |
Incident Field | Field Map |
comments | Journal field |
work_notes | Journal field |
# | Field | Description | Value |
* | Message | The Message this Field record is linked with. | 'UpdateIncident' |
3 | Description | Describe what this field is for and any specific details that might help you in future. | 'The incident's comments' |
* | Active | Set to true to use this Field record for processing. | <true> |
4 | Field map | The Field Map this Field record is linked with. | 'IG - Journal field'** |
* | Map to field | Use this Field record to represent a field on a source/target table. | <true> |
* | Table | The primary source/target table that this Field record is mapped to. | 'Incident' [incident] |
5 | Element | The field on the source/target table this Field record is mapped to. | 'Additional comments' |
6 | Path | Where in the payload the data will be placed. | 'detail' |
* | Property | The property in the payload the data will be written to. | Automatically populated |
* | Inbound | Set to true to use for inbound Messages. | <true> |
* | Outbound | Set to true to use for outbound Messages. | <true> |
# | Field | Description | Value |
9 | Element | The field on the source/target table this Field record is mapped to. | 'Work notes' |
* | Property | The property in the payload the data will be written to. | Automatically populated |
10 | Description | Describe what this field is for and any specific details that might help you in future. | 'The incident's work notes' |
Congratulations on completing this bidirectional asynchronous Incident integration Guide.
This Guide has shown us how to configure an asynchronous Incident integration, sending bidirectional messages via the REST service. The elements we configured were:
Process
Integration
Connections
Messages
Fields
The items automatically created by Unifi were:
Web Service
Trigger
In testing our integration, we created, updated and resolved an Incident - following the data as it flowed from our ServiceNow Incident record, through the Unifi transaction message bus, to the external system's Incident record.
By Using the Unifi integration platform, we have discovered that building and testing our integration is simpler and more efficient, saving both time and money. Our hope is that this Guide has been a valuable aid to you in that process.
For further information please see our technical documentation.
If you have any feedback or questions, please contact us via our website contact form.
#
Field
Description
Value
1
Message name
The message name that is unique for this integration.
'Response'
2
Type
The primary purpose of the message.
'Response'
3
Direction
The direction(s) this message is configured to support. (Choices: Inbound, Outbound, Bidirectional)
'Bidirectional
#
Field
Description
Value
1
Name
The name of the integration.
<Your Name>
*
Service type
The type of web service this integration is using (Choices: SOAP/REST).
'REST'
*
Message format
Automatically pre-process incoming messages for simpler message scripting. (Choices: XML, JSON, Advanced)
'JSON'
# | Field | Description | Value |
1 | Name | Descriptive name, e.g. DBAs, Network, etc. | <Your Name |
2 | Type | Types of this group. | 'itil', 'eBonding' |
3 | Unifi Integrations* | Glide List referencing the Integration [x_snd_eb_integration] table. | <Your Integration> |
For each of our Scenarios we will need to configure the relevant Messages & Fields. This scenario will need to be tested before moving on to the next.
The Message we shall be configuring for our Resolve Scenario is:
ResolveIncident
We will define which Field records require configuring for that Message at the appropriate time.
The scenario will need to be successfully tested before we can say it is complete.
We shall look in detail at each of the Messages and their respective Fields in turn over the next few pages, before moving on to Test.
The ResolveIncident Message is an update type message that we will configure to deal specifically with our resolve scenario (resolve the bonded records).
Again, after clicking the 'Messages' icon, you are directed to the following screen (note: the five previously configured messages are now visible in the list):
1) Click the ellipsis to the right of the UpdateIncident Message & then click Copy.
Rather than create the ResolveIncident Message from scratch, it will be quicker to copy the UpdateIncident Message and make some minor changes.
The fields to edit for the Copy Message modal are as follows:
Your Copy Message modal should look like this:
3) Click Copy.
You will be redirected to the Details page of the newly created ResolveIncident Message.
Navigate to Message > Bond.
The Bond fields to be edited are as follows:
Your Bond form should look like this:
6) Navigate to Outbound > Trigger.
The Outbound Trigger (as required)* fields to be edited are as follows:
*Outbound condition (as required):
It is not necessary for you to enter a condition. The value given is an example. You may create any condition (or not) to align with your business process requirements. in this case it makes sense to send the Resolve message when the Incident is Resolved.
Your Outbound Trigger form should look like this:
9) Click Save.
We are now ready to configure the Fields for our ResolveIncident Message.
We will utilise the Field & Field Map records to configure the Message Scripts for the ResolveIncident Message.
The 'message_header', 'incident.comments', 'incident.work_notes' and 'incident.short_description' Field records are already be in place because they were also copied when we copied the Message. We can choose to include, or exclude as many of those and the Integration level ones that are available depending on our requirements (by either activating or deactivating the relevant Fields). We have chosen not to include 'incident.short_description' in our mappings, so we'll delete that.
In Unifi Integration Designer, from the ResolveIncident Message, navigate to Message > Fields.
1) Click on the ellipsis to the right of the incident.short_description Field & click Delete.
2) Confirm Delete.
Deleting here only deletes the Field record for this message. The integration level record and any other message level ones remain in place.
Unifi created the incident.state (Integration level) Field record earlier. It is, therefore, displayed in the list with Active set to false.
The fields to be changed to configure the incident.state (Message level) Field record are as follows:
By simply setting the Active flag to true on the Integration level Field record listed on the Message, Unifi has created the Message level counterpart.
Your ResolveIncident Message Fields page should look like this:
The empty circle icon next to the Field name turns green & contains a green ‘check’ (to indicate that Message level configuration exists for this Field).
We will now configure Field records for the two remaining Incident record field elements which are required.
The table below lists the Incident record field elements we will map and the relevant Field Maps required to configure each Field record.
*Field map: Values may vary (dependent on your configuration of the copies). Choose the copy Field Maps you created earlier.
There is no need to ‘Generate field choices’ for Message level Field records because the Field Map always looks for them on an Integration level Field which has the same name.
As with 'incident.state' the 'incident.close_code' Field record is a Choice 'type' Field. We will, therefore, configure the choices once at the Integration level. We’ll first configure the Message level Field and then move on to configure the choices on its Integration level counterpart.
From the ResolveIncident Message, navigate to Message > Fields. Click New.
The fields to be configured for our incident.close_code (Message level) New Field modal are as follows:
*These fields are automatically defaulted to true, or automatically populated.
**Field map: Value may vary. Choose the copy Field Map you created for your Integration.
Your 'incident.close_code' (Message level) New Field modal should look like this:
9) Submit the record.
You will be redirected back to the Fields page of the ResolveIncident Message.
You will need to 'Generate field choices' for this Integration level Choice 'type' Field.
Navigate to the 'Fields' icon to open the Fields page.
10) Click to open the incident.close_code (Integration level) Field record (the one where Message is empty).
The incident.close_code Field record opens to the Details page.
11) Navigate to Field > Field Choices.
12) Click Generate field choices.
13) Click Generate on the 'Generate field choices' modal which displays.
The Field Choices are generated & now visible in the list.
From the ResolveIncident Message, navigate to Message > Fields. Click New.
The fields to be configured for the incident.close_notes New Field modal are as follows:
*These fields are automatically defaulted to true, or automatically populated.
**Field map: Value may vary. Choose the copy Field Map you created for your Integration.
Your 'incident.close_notes' New Field modal should look like this:
19) Submit the record.
You will be redirected back to the Fields page of the ResolveIncident Message.
Now that we’ve configured the Field records for the ResolveIncident message, we are ready to build our message scripts.
To quickly navigate to the ResolveIncident message from the Details page of the newly created incident.close_notes Field record…
...click the 'Preview' icon to the left of the Message field.
From the ResolveIncident message, navigate to Message > Fields.
The following Field records should now be in place for your ResolveIncident messsage:
20) Click on Build Message.
You will see the 'Message build successful' Info Message.
21) Navigate to Advanced > Script Editor to view the auto-generated code.
Your Script Editor fields should look like this:
The newly auto-generated code will appear between a Begin & End Comment immediately prior to any code that may already be there (pre-existing code will be retained).
We are now ready to Test our ResolveIncident Message.
The first step to building the other half of the Integration is to export it from one instance and import it to the other.
NOTE: The ServiceNow System Administrator (admin) role is required to see the automatic download and view updates in the Update Set (and to select Application Scope - if required).
Using the Packager feature makes moving integrations between instances simpler and more efficient than ever.
In Unifi Integration Designer, navigate to and open < Your Integration >.
Click the 'Integration' icon to open the Details page.
Click Package.
The Package Integration modal is displayed.
Confirm by clicking Package.
Unifi packages the Integration into an Update Set which is automatically downloaded.
The Integration Package Worker modal is displayed.
The modal tells us how many records were processed and the name of the Update Set that was created (the integration name prepended with the date/time).
Copy the name of the Update Set.
Click Done to close the modal.
Navigate to the downloaded Update Set and Show in folder*.
*Example shown in Chrome. Other browsers may vary.
Then rename the file (using your Update Set name in order to easily identify it when uploading to the other instance).
In the Application Navigator of the external instance, navigate to System Update Sets > Retrieved Update Sets.
At the bottom of the Retrieved Update Sets list, click the Import Update Set from XML related link.
If you have the UI16 Developer Patch installed (download from Share by clicking here), you can navigate directly to the Import XML page from the context menu of the Update Set Picker by clicking Import from XML.
The Import XML screen is displayed:
Click Choose file to upload the previously downloaded file.
Upload.
You are redirected back to the Retrieved Update Sets list view:
Open the Update Set
Your Retrieved Update Set form is displayed:
Click Preview Update Set.
Close the Update Set Preview modal.
Click Commit Update Set.
Close the Update Set Commit progress modal.
We have successfully installed the application containing our Integration on the external instance. The vast majority of the configuration is already in place. All that remains is to make a few configuration changes and Reconfigure the Connections to enable each instance to connect with the other.
Follow these steps to test the UpdateIncident Message.
Navigate to < Your Incident > created in the previous test.
Your Incident record should look like this:
1) Enter < Your Work notes > in the 'Work notes' field.
2) Click Post.
You should see an Info Message, confirming the UpdateIncident Message is being sent to your Integration:
The Work note is added to the Activities stream on the 'Notes' tab:
Click through to the Bond record from the related list on the Incident.
Your Bond record should have been updated as follows:
3) Transaction:
Message: 'Updateincident'
Direction: 'Outbound'
Transaction state: 'Complete' (The data has been successfully transported)
Process state: 'Accepted' (The transaction was accepted as within the scope of the business logic that's in place)
Click through to the Transaction record from the related list on the Bond.
Your Transaction record should look like this:
4) Transaction details:
Table: 'Incident [incident]'
Document: < Your Incident >
Integration: < Your Integration >
Connection: < Your Connection >
Bond: < Your Bond >
Message: 'UpdateIncident'
Direction: 'Outbound'
Transaction state: 'Complete' (The data has been successfully transported)
Process state: 'Accepted' (The transaction was accepted as within the scope of the business logic that's in place)
5) Errors:
Error: (If there was a transactional error the Transaction state would show as 'Error' and the details would be captured here).
Process error: (If there was a process error the Process state would show as 'Rejected' and the details would be captured here)
6) Stages:
Direction: 'Outbound' & 'Inbound'
Message: 'UpdateIncident' & 'Receipt'
Internal reference: < ServiceNow ticket reference > (Same as 'Document')
External reference: < External system's ticket reference >
Click through to the Outbound Stage record from the related list on the Transaction. (If you wish, you could also do the same for the Inbound Stage record.)
Check the values in the fields match what you expect.
Your Stage record should look like this:
7) Stage details:
Direction: 'Outbound'
External reference: < External system's ticket reference >
Internal reference: < ServiceNow ticket reference >
Snapshot: < Snapshot record reference >
Message: 'UpdateIncident'
Transaction: < Your Transaction >
Integration: < Your Integration >
8) Mapped Staged Data fields:
work_notes: < Your Work note >
Click through to the Outbound HTTP Request record from the related list on the Transaction. (If you wish, you could also do the same for the Inbound HTTP Request record.)
Your HTTP Request record should look like this:
9) HTTP Request details:
Integration: < Your Integration >
Connection: < Your Connection >
Transaction: < Your Transaction >
Message: 'UpdateIncident'
Direction: 'Outbound'
Request state: 'OK' (There are no errors with the HTTP Request.)
Attempt number: < Number of HTTP Request attempts > (Failed requests are retried up to the maximum attempts number as configured on the Integration.)
Endpoint URL: < The external system’s access URL >
Action Method: 'POST'
Request headers: < The header of the request being sent >
Request payload: < The payload of the request being sent >
10) Response details:
Status code: '200'
Response headers: < The header of the response being received >
Response payload: < The payload of the response being received >
Navigate to the corresponding Incident in the external system.
Check the values in the fields match those you noted when you saved the Incident in the internal system.
Your external system's Incident record should look like this (depending on the system you're integrating with, your record may look different; the important matter is that the values match):
11) Activities: < Your Work note > (added by < your.external.system.user >)
Repeat the steps above - this time placing a check in the 'Additional comments (Customer visible)' checkbox.
What do you expect to happen?
As when testing our CreateIncident Message, if completing this test after having integrated with the external system (as opposed to connecting to your own instance), it would be good to test the UpdateIncident Message in both directions.
We are now ready to move to the Resolve Scenario.
Building the other half of our integration is much easier than you think.
If you're asking yourself, 'Do we have to do all that again?' the short answer is no, we don't. When using Unifi both ends, building the other half of the integration is a simple two-stage process.
First we Move the Integration, exporting it from one instance and importing it to the other (creating a mirror image in the other instance).
Second we Reconfigure the Connections so that each is pointed at the other.
We will look at both in more detail over the next couple of pages.
Follow these steps to test the ResolveIncident Message.
Navigate to < Your Incident > created in the earlier test.
Update the Incident record as follows:
Your Incident record should look like this:
4) Right-click & Save.
You should see an Info Message, confirming the ResolveIncident Message is being sent to your Integration:
The Activities stream is updated with the details:
Click through to the Bond record from the related list on the Incident.
Your Bond record should have been updated as follows:
5) Transaction:
Message: 'Resolveincident'
Direction: 'Outbound'
Transaction state: 'Complete' (The data has been successfully transported)
Process state: 'Accepted' (The transaction was accepted as within the scope of the business logic that's in place)
Click through to the Transaction record from the related list on the Bond.
Your Transaction record should look like this:
6) Transaction details:
Table: 'Incident [incident]'
Document: < Your Incident >
Integration: < Your Integration >
Connection: < Your Connection >
Bond: < Your Bond >
Message: 'ResolveIncident'
Direction: 'Outbound'
Transaction state: 'Complete' (The data has been successfully transported)
Process state: 'Accepted' (The transaction was accepted as within the scope of the business logic that's in place)
7) Errors:
Error: (If there was a transactional error the Transaction state would show as 'Error' and the details would be captured here).
Process error: (If there was a process error the Process state would show as 'Rejected' and the details would be captured here)
8) Stages:
Direction: 'Outbound' & 'Inbound'
Message: 'ResolveIncident' & 'Receipt'
Internal reference: < ServiceNow ticket reference > (Same as 'Document')
External reference: < External system's ticket reference >
Click through to the Outbound Stage record from the related list on the Transaction. (If you wish, you could also do the same for the Inbound Stage record.)
Check the values in the fields match what you expect.
Your Stage record should look like this:
9) Stage details:
Direction: 'Outbound'
External reference: < External system's ticket reference >
Internal reference: < ServiceNow ticket reference >
Snapshot: < Snapshot record reference >
Message: 'ResolveIncident'
Transaction: < Your Transaction >
Integration: < Your Integration >
10) Mapped Staged Data fields:
close_code: < Your Resolution code >
close_notes: < Your Resolution notes >
state: '6'
Click through to the Outbound HTTP Request record from the related list on the Transaction. (If you wish, you could also do the same for the Inbound HTTP Request record.)
Your HTTP Request record should look like this:
11) HTTP Request details:
Integration: < Your Integration >
Connection: < Your Connection >
Transaction: < Your Transaction >
Message: 'ResolveIncident'
Direction: 'Outbound'
Request state: 'OK' (There are no errors with the HTTP Request.)
Attempt number: < Number of HTTP Request attempts > (Failed requests are retried up to the maximum attempts number as configured on the Integration.)
Endpoint URL: < The external system’s access URL >
Action Method: 'POST'
Request headers: < The header of the request being sent >
Request payload: < The payload of the request being sent >
12) Response details:
Status code: '200'
Response headers: < The header of the response being received >
Response payload: < The payload of the response being received >
Navigate to the corresponding Incident in the external system.
Check the values in the fields match those you noted when you saved the Incident in the internal system.
Your external system's Incident record should look like this (depending on the system you're integrating with, your record may look different; the important matter is that the values match):
13) State: 'Resolved'
14) Resolution code: < Your Resolution code >
15) Resolution notes: < Your Resolution notes >
Navigate to the Notes tab.
Your Notes tab should look like this:
16) Activities: < Your Resolution code/notes & State > (added by < your.external.system.user >)
As when testing our previous scenarios, if completing this test after having integrated with the external system (as opposed to connecting to your own instance), it would be good to test the ResolveIncident Message in both directions.
If you have completed this testing for the first time (sending to your own instance only), you are now ready to move on and look at running Build at the Integration level.
It is possible to run the Build process from the Integration. This will cause the process to cycle through each of the Messages on the Integration in turn.
We have been running the Build process at the Message level in order to see the changes in our Message Scripts as we go. This may be considered good practice (particularly when first starting out) as any discrepancies can be discovered & rectified as you go (in potentially fewer, smaller batches). Once you are more practiced and confident in the accuracy of your configurations, you can run the Build process at the Integration level. This means that the process will cycle through all the Field records on each of the Messages on the Integration in turn & auto-generate all the relevant Message Script code.
As mentioned in the 'CreateIncidentReceipt Fields' page, we saw that a 'Build Integration' button had appeared in the banner at the top of the page. This was because, whenever a change is made to a Field record that is associated to a Message (whether that is being created, updated, or deleted) the button will be available and act as a visual reminder that changes have been made and Message Script(s) need to be built.
To run the Build Process at the Integration level we have two choices. We can either either run it from the Integration record, or we can use the 'Build Integration' button which appears in the banner at the top of the page.
To run it from the Integration record. In Unifi Integration Designer, navigate to: 'Integration' icon.
1) Click Build.
2) On the Build Integration modal, click Build.
When complete, you will see the following Integration Build Worker modal:
3) Click Done.
Navigate to: 'Messages' icon.
Feature Alert: The widget at the bottom of the page also shows when 'Build' was last run.
Click through each Message in turn, navigating to Advanced > Script Editor to view the auto-generated code in the Message Scripts.
We have now built and tested the integration in one instance. We are now ready to move on and Build the other half.
The next step in building the other half of the Integration is to reconfigure the connections.
Now that both halves of the Integration are in place, we need to reconfigure each of the Connections to point to the other instance. Before doing that though, we need to create a new Inbound User for the external instance.
To configure our Integration user:
In native ServiceNow, navigate to User Administration > Users. Click New.
The fields to be configured for the User record are as follows:
The x_snd_eb.integration role gives access to the Unifi web services. You may need to assign additional roles depending on the process functionality used i.e. things like gs.hasRole(‘itil’) in business rules/scripts etc.
This Inbound user will become the Outbound user in the other instance. We will need to update the other instance accordingly.
We are going to edit the existing 'Development' Connection so that it will become our 'Test' Connection and use the Inbound user just created.
We will need to have our other instance point to this external one also (not only to itself). Therefore, we will create a new 'Test' Connection in the other instance to do that. (See the .)
In Unifi Integration Designer, navigate to the 'Connections' icon.
6) Click to open the previously created Development Connection to edit it.
Edit the values in the Connection as follows:
*Inbound user created above.
Your Connection form should look like this
We have not updated the Endpoint URL nor the Outbound User because they already contain the correct values (i.e. the internal instance's Endpoint & Inbound user).
9) Save the Connection.
Back in the internal instance, navigate to the 'Connections' icon. Click New.
We could have edited our existing 'Development' Connection to point to the external instance (instead of itself). We have chosen instead to create a new 'Test' Connection to do that. That way we have two Connections, a 'Development' Connection which points to itself and a 'Test' connection which points to the external instance.
The fields to be configured for the New Connection modal are as follows:
The entire Endpoint URL for this Test environment Connection can be easily obtained from the automatically created Message Resource on the Unifi Scripted REST API (displayed in the widget at the top of the Connections page of the external instance - as shown above).
For our Outbound User we will use the external system's Inbound User (as created above).
Your New Connection modal should look like this:
13) Submit and view to further configure the Connection.
Clicking ‘Submit’ will redirect you to the list view of the record you’re creating. Clicking ‘Submit and view' will redirect you to the newly created record.
The fields to be configured for the Details form are as follows:
(External) User/Password: As created above & set in the external instance.*
Your Details form should look like this:
18) Save the Connection.
There will now be both a Development and a Test Connection for your Integration. Only the Test Connection should be Active.
These can be viewed by clicking the 'Connections' icon.
We have completed building the other half of the Integration. We are now ready to go back and repeat the Testing for each of the scenarios we've built.
See the following pages:
At this stage you can carry our a basic Connection Test ().
As above, you can carry our a basic Connection Test ().
#
Field
Description
Value
2
Message name
The message name that is unique for this integration.
'ResolveIncident'
#
Field
Description
Value
4
Bond suspended
Process this message when the bond state is Suspended (internal suspend).
<true>
5
Bond vendor suspended
Process this message when the bond state is Vendor suspended (external suspend).
<true>
#
Field
Description
Value
7
Outbound condition*
The condition that the ServiceNow record must meet to trigger this message being processed.
'State > changes to > Resolved'
8
Outbound condition*
The script that must be met for the message to be processed. Use current to get access to the triggering record.
[Blank]
#
Field
Description
Value
3
Active
Set to true to create a Message level Field record from its Integration level counterpart.
<true>
Incident Field
Field Map
close_code
'IG - Choice'*
close_notes
'IG - String'*
#
Field
Description
Value
*
Message
The Message this Field record is linked with.
'ResolveIncident'
4
Description
The description of this Field record.
'The incident's Resolution code (Close code in ServiceNow)'
*
Active
Set to true to use this Field record for processing.
<true>
5
Field map
The Field Map this Field record is linked with.
'IG - Choice'**
*
Map to field
Use this Field record to represent a field on a source/target table.
<true>
*
Table
The primary source/target table that this Field record is mapped to.
'Incident' [incident]
6
Element
The field on the source/target table this Field record is mapped to.
'Resolution code'
7
Path
Where in the payload the data will be placed.
'detail'
*
Property
The property in the payload the data will be written to.
Automatically populated
*
Inbound
Set to true to use for inbound Messages.
<true>
*
Outbound
Set to true to use for outbound Messages.
<true>
8
Mandatory
Set to true to make mandatory.
<true>
#
Field
Description
Value
*
Message
The Message this Field record is linked with.
'ResolveIncident'
14
Description
The description of this Field record.
'The incident's Resolution notes (Close notes in ServiceNow)'
*
Active
Set to true to use this Field record for processing.
<true>
15
Field map
The Field Map this Field record is linked with.
'IG - String'**
*
Map to field
Use this Field record to represent a field on a source/target table.
<true>
*
Table
The primary source/target table that this Field record is mapped to.
'Incident' [incident]
16
Element
The field on the source/target table this Field record is mapped to.
'Resolution notes'
17
Path
Where in the payload the data will be placed.
'detail'
*
Property
The property in the payload the data will be written to.
Automatically populated
*
Inbound
Set to true to use for inbound Messages.
<true>
*
Outbound
Set to true to use for outbound Messages.
<true>
18
Mandatory
Set to true to make mandatory.
<true>
# | Field | Description | Value |
7 | Environment | The environment this connection applies to. | 'Test' |
8 | Inbound user | The user profile used by the external system for authentication. | <Your Inbound user*> |
# | Field | Description | Value |
10 | Environment | The environment this connection applies to. | 'Test' |
11 | Endpoint URL | The external system's access URL. | <External system Endpoint URL> |
12 | Active | Use this connection for the integration when true. | <true> |
# | Field | Description | Value |
14 | Authentication | The authentication method to use for this connection. | 'Basic' |
15 | User* | The username used in basic authentication. | <external.system.user> |
16 | Password* | The password used in basic authentication. | <External system user password> |
17 | Inbound user | The user profile used by the external system for authentication. An active connection must be found for the user to gain access. | <lookup: Your Inbound User> |
# | Field | Description | Value |
1 | User ID | The id of the user (to be used by the external system for authentication). | <your.integration.user> |
2 | First name | The integration user's first name. | <Your First Name> |
3 | Last name | The integration user's last name. | <Your Last Name> |
4 | Password | The user's password (to be used in basic authentication). | <Your Password> |
5 | Roles | The role required for access to the integrated records. | x_snd_eb.integration |
#
Field
Description
Value
1
State
The Incident lifecycle state.
'Resolved'
2
Resolution code
The Incident resolution code.
<Your Resolution code>
3
Resolution notes
The Incident resolution notes.
<Your Resolution notes>