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.
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.
Field | Description | Value |
---|---|---|
Field | Description | Value |
---|---|---|
Field | Description | Value |
---|---|---|
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'
State | The Incident lifecycle state. | 'Resolved' |
Resolution code | The Incident resolution code. | <Your Resolution code> |
Resolution notes | The Incident resolution notes. | <Your Resolution notes> |
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)'