Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
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 the 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.
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:
Field | Description | Value |
---|---|---|
*Service type/Message format: these values are defaulted.
Your 'New Integration' modal should look like this:
We have chosen to name this integration 'Push-Pull Incident' as it will also later form the basis for the Poller Guides (where we pull data from your Personal Developer Instance, ‘PDI’).
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 form should look like this:
Navigate to Settings > Feedback.
The Feedback fields to be configured for the Integration record are as follows:
The Feedback Settings fields should look like this:
The remaining 'Integration' values are to be left as-is:
Message Identification
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
Click Save.
Click the 'Connections' icon to move on and configure the Connection.
Field | Description | Value |
---|---|---|
Enable UI messages
Allow information and error messages to be shown to the user as UI Notifications. Only applies to certain notifications.
<true>
Note bond history
Use the 'Note bond history' to process bond history updates. (Set to true for the history to be promoted to the work notes fields of the record we're integrating - for the analyst to view)
<true>
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'
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:
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).
This is given for your information only as we are only concerned in this Guide with sending outbound messages to the table API of another ServiceNow instance (i.e. your Personal Developer Instance, ‘PDI’). However, It will be of value should you go on to configure polling integrations following our Poller Guides (which will utilize this same Process).
Follow this guide to configure a simple outbound integration to the table API of your Personal Developer Instance. It is given as an aid for those new to Unifi, or to play as part of a trial.
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 Outbound Incident Guide as an aid to customers who are beginning their journey in deploying the Unifi integration platform. We would not want you to be overwhelmed by exploring all that Unifi has to offer here, so we have deliberately limited the scope of this document. It will guide you through an example of how to configure a basic Incident integration, sending outbound messages via the REST API to the table API of another ServiceNow instance (i.e. your Personal Developer Instance, ‘PDI’).
We do not recommend synchronous integrations for enterprise ticket exchange. This Guide is purely here for you to have a play as part of a trial. It is designed to connect to a PDI without Unifi being installed on the other side.
For more technical information on how to use Unifi, please see our .
Do not build integrations directly within the Unifi application scope. This can create issues with upgrades and application management.
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.
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 the Create Scenario are:
CreateIncidentResponse
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.
The Connection allows messages to be sent and received and stores all the authentication details of the Integration specific to a single environment.
Before configuring the Connection, you need to ensure you have a user in the instance to use as the Inbound user for the Integration. To configure your Inbound 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:
Field | Description | Value |
---|
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. Note: this role is not required for this integration as we are only sending outbound messages. However, it will be used when following the Poller Guides, receiving messages to the automatically created inbound endpoints.
Your User record should look like this:
Although you can set up many connections to enable switching between environments (one connection per environment), it is worth noting that only one connection can be active for an Integration at a time.
We will, however, set up only one connection in 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.
This is given for your information only as we are only concerned in this Guide with sending outbound messages to the table API of another ServiceNow instance (i.e. your Personal Developer Instance, ‘PDI’). However, It will be of value should you go on to configure polling integrations following our Poller Guides (which will utilize this same Connection).
Click New.
The fields to be configured for the New Connection modal are as follows:
The format of the Endpoint URL for the ServiceNow Table API is as follows:
https://<your_developer_instance>.service-now.com/api/now/table/<table_name>
If you are going to configure this Outbound Integration only, then use the full URL e.g. https://<your_developer_instance>.service-now.com/api/now/table/incident
If you are going to configure the Pollers also, then truncate the URL as follows https://<your_developer_instance>.service-now.com/api/now
In which case, the /table/incident
part of the URL will need to be added to the 'Path' of the outbound messages (and the Endpoint URLs of the relevant Pollers).
Your New Connection modal should look like this:
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:
*(External) User/Password: As created/set in your PDI.
**Inbound user: As created above.
Your Details form should look like this:
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.
If you attempt the test against the truncated URL you will receive this error.
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.
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).
Field | Description | Value |
---|---|---|
Field | Description | Value |
---|
This will facilitate this same connection being used for both the Table API and Attachment API (as per the ).
Field | Description | Value |
---|
Name
The name of the ServiceNow process being integrated.
<SN Process Name> (e.g. Incident)
API Name*
The unique name of this process for use with the API.
<your_unique_api>
Target table
The primary target or process table that this integration uses.
'Incident' [incident]
Reference field
The field on the target table that is used as the reference for the external system.
'Number'
Description
Describe what this Process is for.
<Your description>
Environment | The environment this connection applies to. | 'Development' |
Endpoint URL | The external system's access URL. | <External system Endpoint URL> |
Active | Use this connection for the integration when true. | <true> |
Authentication | The authentication method to use for this connection. | 'Basic' |
User* | The username used in basic authentication. | <external.system.user> |
Password* | The password used in basic authentication. | <External system user password> |
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> |
User ID | The id of the user (to be used by the external system for authentication). | <your.integration_user> |
First name | The integration user's first name. | <Your First Name> |
Last name | The integration user's last name. | <Your Last Name> |
Password | The user's password (to be used in basic authentication). | <Your Password> |
Roles | The role required for access to the integrated records. | 'itil', 'x_snd_eb_integration' |
The CreateIncidentResponse Message is the immediate, synchronous response that is sent after processing the Createincident Message.
In Unifi Integration Designer, navigate to the 'Messages' icon. Click New.
The fields to be configured for the CreateIncidentResponse New Message modal are as follows:
Field | Description | Value |
---|---|---|
Your CreateIncidentResponse New Message modal should look like this:
Click Submit and view to further configure the Message.
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:
Setting the Bond state to Open allows messages to be sent/received. See the 'Bonds' page for details.
Click Save.
We are now ready to configure the Fields for our CreateIncidentResponse Message.
Field | Description | Value |
---|---|---|
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'
Message name
The message name that is unique for this integration.
'CreateIncidentResponse'
Type
The primary purpose of the message.
'Response'
Direction
The direction(s) this message is configured to support. (Choices: Inbound, Outbound, Bidirectional)
'Inbound'
We will utilise the Field & Field Map records to configure the Message Scripts for the CreateIncidentResponse 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 Map we shall use for our CreateIncidentResponse Field record is:
Source Reference
To copy the Source Reference Field Map, navigate to the 'Field Maps' icon.
Click on the ellipsis to the right of the Source Reference Field Map & click Copy.
The fields to edit for the Copy Field Map modal are as follows:
*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).
Your Copy Field Map modal should look like this:
Integration should be automatically populated.
Click Copy.
You will be redirected to the Details page of the newly created Field Map.
In Unifi Integration Designer, from the CreateIncidentResponse page, navigate to Message > Fields. Click New.
The fields to be configured for the sys_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.
Property: We are setting 'sys_id' as the property because that is what is required by the table API. If it were possible, it would better to use something more meaningful, like the Number of the ticket integrated with, as this aids in debugging.
The 'result.sys_id' New Field modal should look like this:
Submit the record.
You will be redirected back to the Fields page of the CreateIncidentResponse Message.
Now that we’ve configured the Field records for the CreateIncidentResponse message, we are ready to build our message scripts.
The following Field record should now be in place for your CreateIncidentResponse 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.
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.
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).
We will now examine our new, auto-generated Message Script.
Payload to Stage:
Both the stage & bond external reference are being set to the sys id only because we are integrating with the table API and that's what it requires. If possible, it is better to use something more meaningful, like the Number of the ticket integrated with, as this aids in debugging.
Once you have finished examining the code, click 'Close' to navigate back to the Fields page of the CreateIncidentResponse Message.
Next, we will configure the CreateIncident 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.
The CreateIncident Message will create a ticket on the target table of the integrated system.
After clicking the 'Messages' icon, you will see the following screen (note: the previously configured message is visible in the list):
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:
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:
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:
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.
Your Outbound Trigger form should look like this:
Navigate to Outbound > Settings.
The Outbound Settings fields to be configured are as follows:
*Path
Only add this value if you have used the truncated Endpoint URL in the Connection. If you have used the full Endpoint URL, this step can be skipped.
Your Outbound Settings form should look like this:
Click Save.
We are now ready to configure the Fields for our CreateIncident Message.
Field | Description | Value |
---|---|---|
Field | Description | Value |
---|---|---|
Field | Description | Value |
---|
Field | Description | Value |
---|
Field | Description | Value |
---|
Field | Description | Value |
---|
Field | Description | Value |
---|
Name*
The name of your field map. (If left unedited, it will append the word 'Copy' to the existing name.)
<Your Name>
Message*
The Message this Field record is linked with.
'CreateIncidentResponse'
Description
Describe what this field is for and any specific details that might help you in future.
'Extract returned sys_id & store in stage.external_reference'
Active*
Set to true to use this Field record for processing.
<true>
Field map
The Field Map this Field record is linked with.
'PI - Source Reference'**
Map to field*
Use this Field record to represent a field on a source/target table.
<false>
Path
Where in the payload the data will be placed.
'result'
Property
The property in the payload the data will be written to.
'sys_id'
Inbound*
Set to true to use for inbound Messages.
<true>
Outbound
Set to true to use for outbound Messages.
<false>
Message name | The message name that is unique for this integration. | 'CreateIncident' |
Type | The primary purpose of the message. | 'Create' |
Direction | The direction(s) this message is configured to support. | 'Outbound' |
Response | The immediate synchronous response to this message. | lookup: 'CreateIncidentResponse' |
Async* | Turn this option on if you want inbound processing to occur asynchronously or this message is the first of an asynchronous message pair. | <false> |
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' |
Bond new | Process this message when a new bond is required. | <true> |
Outbound condition* | The condition that the ServiceNow record must meet to trigger this message being processed. | <Your condition> e.g. 'Short description contains Push-Pull Integration' |
Path* | A path to append to the URL defined in the connection. Specify a full URL to override the connection. Define inline scripts to reference Stage to Request script variables by wrapping code in braces {}, e.g. /{transaction.message_id}. | '/table/incident' |
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' |
We will test our CreateIncident Message.
Navigate to Incident > Create New.
The Incident fields to configure are as follows:
Field | Description | Value |
---|---|---|
*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:
Right-click & Save.
Note the values entered (including State & Priority), 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:
You should also see a note in the Activities stream:
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:
A Bond has been created. The State remains 'Pending' until the list is refreshed.
Refresh the list by clicking Bonds.
You should see the External reference populated & the State changed to 'Open':
We are using a sys_id for the External reference in our example because we are integrating with the table API. If possible, it is better to use something more meaningful, like the Number of the ticket integrated with, as this aids in debugging.
Click the Bond Number link to open the Bond record.
Your Bond record should look like this:
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 >
Transaction:
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.
Transaction process next queued: Logs from checking whether there are any other transactions queued and processing those.
Transaction sending: Logs from taking the Stage data, building the Request record & sending the Request to the integrated system.
Business rule: < Your Trigger >: Logs from the Business Rule that triggers Unifi.
Click through to the Transaction record from the related list on the Bond.
Your Transaction record should look like this:
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)
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)
Stage:
Direction: 'Outbound'
Message: 'CreateIncident'
Internal reference: < ServiceNow ticket reference > (Same as 'Document')
External reference: < External system's ticket reference >
Click through to the Stage record from the related list on the Transaction.
Check the values in the fields match what you expect.
Your Stage record should look like this:
Stage details:
Direction: 'Outbound'
External reference: < External system's ticket reference >
Internal reference: < ServiceNow ticket reference >
Snapshot: < Snapshot record reference >
Message: 'CreateIncident'
Transaction: < Your Transaction >
Integration: < Your Integration >
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 HTTP Request record from the related list on the Transaction.
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:
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 >
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):
Caller: < Your Caller >
State: < Your State >
Short description: < Your Short description >
Activities: < Note showing activity on the Incident > (Opened by < your.external.system.user > configured in the Connection)
We are now ready to move on to the Update Scenario.
We will utilise the Field & Field Map records to configure the Message Scripts for the CreateIncident Message.
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.
Incident Field | Field Map |
---|---|
*caller_id: we have chosen String type here because we are integrating with the table API. This will return the sys id of the caller as a string value. Note: If we were integrating Unifi to Unifi we may use a Reference type which would return the caller as an object with "value", "link" & "display_value" elements.
The Field records we will focus on will be for Caller (String), 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:
String
Choice
See Copy Field Maps (on the 'CreateIncidentResponse Fields' page) for details.
In Unifi Integration Designer, from the CreateIncident page, 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:
Submit the record.
You will be redirected back to the Fields page of the CreateIncident Message.
Because the incident.short_description Field record is the same 'type' (PI - String) & the majority of the settings are the same as the previously configured Field, it will be quicker to copy the incident.caller_id Field & make a few minor changes.
Feature Alert: The 'result.sys_id' Field 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 (in CreateIncidentResponse Fields). We'll talk in more detail about this feature in the following section.
Click the ellipsis next to the incident.caller_id 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:
Click Copy.
You will be redirected to the Details page of the newly created incident.short_description Field record.
The following info message is also displayed (which can be closed):
Field inheritance is set to true by default. This means the record will be updated with integration-level Field values when saved (except for Active, Inherit and Message values). Uncheck the Inherit field to configure locally. For more information on Field Inheritance click here.
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 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 we 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.
To quickly navigate to the CreateIncident Message from the Details page of the newly created incident.short_description Field record...
...click the 'Preview' icon to the left of the Message field.
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:
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.
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.
Navigate to Field > Field Choices.
Click Generate field choices.
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 the remaining Field records for the rest of the Incident fields (as per the 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:
Click on Build Message.
You will see the 'Message build successful' Info Message.
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 will now examine our new, auto-generated Message Scripts.
Source to Stage:
Stage to Request:
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'.
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 the Update Scenario are:
Response
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 Response Message is the immediate synchronous response that is sent to acknowledge the successful transport of another Message.
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):
Click New.
The fields to be configured for the Response New Message modal are as follows:
Your Response New Message modal should look like this:
Click Submit.
You will be redirected to the Messages page. You need not configure the Response Message any further.
Now it's time to move on and configure the UpdateIncident 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 Message we shall be configuring for the 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 the Message and its 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 four previously configured messages are now visible in the list):
Click the ellipsis to the right of the UpdateIncident Message & then click Copy.
It is now easier than ever to create the ResolveIncident Message. Rather than create it 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:
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:
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 ResolveIncident Message when the state changes to Resolved.
Your Outbound Trigger form should look like this:
Click Save.
We are now ready to configure the Fields for the ResolveIncident Message.
The UpdateIncident Message is an update type message that sends updates to the bonded record.
After submitting the 'Response' Message, you were redirected to the Messages page (note: the three previously configured messages are now visible in the list):
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:
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:
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:
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.
Your Outbound Trigger form should look like this:
Navigate to Outbound > Settings.
The Outbound Settings fields to be configured are as follows:
*Path
Only include the /table/incident
element of this value if you have used the truncated Endpoint URL in the Connection. If you have used the full Endpoint URL, do not include that element of it here.
Your Outbound Settings form should look like this:
Click Save.
We are now ready to configure the Fields for our UpdateIncident Message.
We will test our UpdateIncident Message.
Navigate to < Your Incident > created in the previous test.
Your Incident record should look like this:
Enter < Your Work notes > in the 'Work notes' field.
Click Post.
The following activities are added to the 'Notes' tab (confirming sending the UpdateIncident Message to your integration):
Click through to the Bond record from the related list on the Incident.
Your Bond record should have been updated as follows:
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:
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)
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)
Stage:
Direction: 'Outbound'
Message: 'UpdateIncident'
Internal reference: < ServiceNow ticket reference > (Same as 'Document')
External reference: < External system's ticket reference >
Click through to the Stage record from the related list on the Transaction.
Check the values in the fields match what you expect.
Your Stage record should look like this:
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 >
Mapped Staged Data fields:
Work notes: < Your Work note >
Click through to the HTTP Request record from the related list on the Transaction.
Your HTTP Request record should look like this:
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: 'PUT'
Request headers: < The header of the request being sent >
Request payload: < The payload of the request being sent >
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):
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?
We will utilise the Field & Field Map records to configure the Message Scripts for the UpdateIncident Message.
The 'incident.short_desccription' (Integration level) Field record should already be in place (i.e. with Active set to false). Creating the Message level counterpart is now easier than ever.
From the UpdateIncident page, navigate to Message > Fields.
Find the incident.short_description (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).
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 two other Incident record field elements.
The table below lists the Incident fields above and the relevant Field Maps required to configure each Field record.
We have chosen String type here because we are integrating with the table API. This will return the contents of those fields as a string value. If we were integrating Unifi to Unifi we may use a Journal field type which would return an array of comments objects with "text", "created_on", "created_by" & "published" elements.
*Field map: Values may vary (dependent on your configuration of the copies). Choose the copy Field Maps you created earlier.
Because the incident.comments Field record is the same 'type' (IS - String) & the majority of the settings are the same as the previously configured Field, it will be quicker to copy the incident.short_description Field & make a few minor changes.
Click the ellipsis next to the incident.short_description 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:
Click Copy.
You will be redirected to the Details page of the newly created incident.comments Field record.
It will again be quicker to copy the previously configured incident.comments Field & make a few minor changes.
To quickly navigate back to the UpdateIncident Message, click the 'Preview' icon next to the Message field on the Details page of newly created incident.comments Field record.
Navigate to Message > Fields.
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:
Click Copy.
You will be redirected to the Details page of 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.
Navigate to the UpdateIncident Message, then navigate to Message > Fields.
The following Field records should now be in place for your UpdateIncident messsage:
Click on Build Message.
You will see the 'Message build successful' Info Message.
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 will now examine our new, auto-generated Message Scripts.
Source to Stage:
Stage to Request:
We are now ready to Test the UpdateIncident Message.
Field | Description | Value |
---|---|---|
Field | Description | Value |
---|---|---|
Field | Description | Value |
---|---|---|
Field | Description | Value |
---|
Field | Description | Value |
---|
Field | Description | Value |
---|
Field | Description | Value |
---|
Field | Description | Value |
---|
Field | Description | Value |
---|
Field | Description | Value |
---|
Field | Description | Value |
---|
Field | Description | Value |
---|
Incident Field | Field Map |
---|
Field | Description | Value |
---|
Field | Description | Value |
---|
caller_id*
String
short_description
String
description
String
category
Choice
impact
Choice
urgency
Choice
state
Choice
comments
String
worknotes
String
Message*
The Message this Field record is linked with.
'CreateIncident'
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>
Field map
The Field Map this Field record is linked with.
'PI - 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]
Element
The field on the source/target table this Field record is mapped to.
'Caller'
Property*
The property in the payload the data will be written to.
Automatically populated
Inbound*
Set to true to use for inbound Messages.
<false>
Outbound*
Set to true to use for outbound Messages.
<true>
Element
The field on the source/target table this Field record is mapped to.
'Short description'
Property*
The property in the payload the data will be written to.
Automatically populated
Description
Describe what this field is for and any specific details that might help you in future.
'The short description of this incident'
Message*
The Message this Field record is linked with.
'CreateIncident'
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>
Field map
The Field Map this Field record is linked with.
'PI - 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]
Element
The field on the source/target table this Field record is mapped to.
'State'
Property*
The property in the payload the data will be written to.
Automatically populated
Inbound*
Set to true to use for inbound Messages.
<false>
Outbound*
Set to true to use for outbound Messages.
<true>
Message name | The message name that is unique for this integration. | 'Response' |
Type | The primary purpose of the message. | 'Response' |
Direction | The direction(s) this message is configured to support. (Choices: Inbound, Outbound, Bidirectional) | 'Inbound' |
Message name | The message name that is unique for this integration. | 'ResolveIncident' |
Bond suspended | Process this message when the bond state is Suspended (internal suspend). | <true> |
Bond vendor suspended | Process this message when the bond state is Vendor suspended (external suspend). | <true> |
Outbound condition* | The condition that the ServiceNow record must meet to trigger this message being processed. | 'State > changes to > Resolved' |
Message name | The message name that is unique for this integration. | 'UpdateIncident' |
Type | The primary purpose of the message. | 'Update' |
Direction | The direction(s) this message is configured to support. | 'Outbound' |
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. | <false> |
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' |
Bond open | Process this message when the bond state is Open. | <true> |
Outbound condition* | The condition that the ServiceNow record must meet to trigger this message being processed. | <Your condition> e.g. 'Work notes changes' OR 'Additional comments changes' |
Path* | A path to append to the URL defined in the connection. Specify a full URL to override the connection. Define inline scripts to reference Stage to Request script variables by wrapping code in braces {}, e.g. /{transaction.message_id}. | '/table/incident/{bond.getValue("external_reference")}' |
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. | 'PUT' |
comments | 'PI - String'* |
work_notes | 'PI - String'* |
Element | The field on the source/target table this Field record is mapped to. | Additional comments |
Property* | The property in the payload the data will be written to. | Automatically populated |
Description | Describe what this field is for and any specific details that might help you in future. | 'The incident's comments' |
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 |
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 Outbound Incident Integration Guide.
This Guide has shown us how to configure a basic Incident integration, sending outbound messages via the REST service. The elements we configured were:
Process
Integration
Connection
Messages
Fields
The items automatically created by Unifi were:
Web Service (not used in this Guide)
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.
Caller*
Person who reported or is affected by this incident.
<Your Caller>
State*
The Incident lifecycle state.
'New' - Default (Automatically populated)
Short description*
A brief description of the incident.
<Your Short description>
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 so as 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 'CreateIncidentResponse Fields', 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.
Click Build.
On the Build Integration modal, click Build.
When complete, you will see the following Integration Build Worker modal:
Click Done.
Navigate to: 'Messages' icon.
Feature Alert: At the bottom right of the window you will see a widget that displays whether the Integration is Active and 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 Outbound Incident Integration.
We will test our ResolveIncident Message.
Navigate to < Your Incident > created in the earlier test.
Update the Incident record as follows:
Field | Description | Value |
---|---|---|
Your Incident record should look like this:
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:
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:
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)
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)
Stage:
Direction: 'Outbound'
Message: 'ResolveIncident'
Internal reference: < ServiceNow ticket reference > (Same as 'Document')
External reference: < External system's ticket reference >
Click through to the Stage record from the related list on the Transaction.
Check the values in the fields match what you expect.
Your Stage record should look like this:
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 >
Mapped Staged Data fields:
close_code: < Your Resolution code >
close_notes: < Your Resolution notes >
state: '6'
Click through to the HTTP Request record from the related list on the Transaction.
Your HTTP Request record should look like this:
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: 'PUT'
Request headers: < The header of the request being sent >
Request payload: < The payload of the request being sent >
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):
State: 'Resolved'
Activities: < Your Resolution code/notes & State > (added by < your.external.system.user >)
Navigate to the Resolution Information tab.
Your Resolution Information tab should look like this:
Resolution code: < Your Resolution code >
Resolution notes: < Your Resolution notes >
So far, when configuring our scenarios we have built the Message Scripts for each Message individually. Let's now see how we can run the Build process at the Integration level.
We will utilise the Field & Field Map records to configure the Message Scripts for the ResolveIncident Message.
The 'incident.comments', 'incident.work_notes' and 'incident.short_description' Field records are already 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 will choose to keep the existing Message level Fields and add the available incident.state (Integration level) Field.
By simply setting the Active flag to true on the Integration level Field record listed on the Message, Unifi will automatically create the Message level counterpart.
Navigate to Message > Fields.
Your ResolveIncident Message Fields page should look like this:
Find the incident.state (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 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 Fields page, 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:
Submit the record.
You will be redirected back to the Fields page of the ResolveIncident 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.
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.
Navigate to Field > Field Choices.
Click Generate field choices.
Click Generate on the 'Generate field choices' modal which displays.
The Field Choices are generated & now visible in the list.
Because the incident.close_notes Field record is the same 'type' (PI - String) & the majority of the settings are the same as the incident.work_notes Field, it will be quicker to copy that Field & make a few minor changes.
From the ResolveIncident Message, navigate to Message > Fields.
Click the ellipsis next to the incident.work_notes Field record & click Copy.
The fields to edit for the Copy Field modal are as follows:
*This field is automatically populated.
Your 'incident.close_notes' Copy Field modal should look like this:
Click Copy.
You will be redirected to the Details page of the newly created incident.close_notes Field record.
The "This message inherits its configuration from the integration-level field..." info message is also displayed (which can be closed).
Field inheritance is set to true by default. This means the record will be updated with integration-level Field values when saved (except for Active, Inherit and Message values).
You can either uncheck the Inherit field to configure locally, or edit the integration-level Field record. We will choose to edit the integration-level because it makes more sense to have the same settings for each message-level incident.close_notes Field (i.e. each will be mandatory).
For more information on Field Inheritance click here.
Navigate to the 'Fields' icon to open the Fields page.
Click to open the incident.close_notes (Integration level) Field record (the one where Message is empty).
The incident.close_notes Field record opens to the Details page.
Navigate to Field > Settings.
Set Mandatory to true.
Click Save.
Now that we’ve configured the Field records for the ResolveIncident message, we are ready to build our message scripts.
Navigate to the ResolveIncident message, then navigate to Message > Fields.
The following Field records should now be in place for your ResolveIncident messsage:
Click on Build Message.
You will see the 'Message build successful' Info Message.
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 was already there.
We will now examine our new, auto-generated Message Scripts.
Source to Stage:
Stage to Request:
We are now ready to Test the ResolveIncident Message.
Incident Field | Field Map |
---|---|
Field | Description | Value |
---|---|---|
Field | Description | Value |
---|---|---|
close_code
'PI - Choice'*
close_notes
'PI - String'*
Message*
The Message this Field record is linked with.
'ResolveIncident'
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>
Field map
The Field Map this Field record is linked with.
'PI - 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]
Element
The field on the source/target table this Field record is mapped to.
'Resolution code'
Property*
The property in the payload the data will be written to.
Automatically populated
Inbound*
Set to true to use for inbound Messages.
<false>
Outbound*
Set to true to use for outbound Messages.
<true>
Mandatory
Set to true to make mandatory.
<true>
Element
The field on the source/target table this Field record is mapped to.
'Resolution notes'
Property*
The property in the payload the data will be written to.
Automatically populated
Description
The description of this Field record.
'The incident's Resolution notes (Close notes in ServiceNow)'
State
The Incident lifecycle state.
'Resolved'
Resolution code
The Incident resolution code.
<Your Resolution code>
Resolution notes
The Incident resolution notes.
<Your Resolution notes>