All pages
Powered by GitBook
1 of 4

Loading...

Loading...

Loading...

Loading...

Resolve 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 Message we shall be configuring for our Resolve Scenario is:

  1. 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.

ResolveIncident MessageResolveIncident FieldsTest ResolveIncident

ResolveIncident Message

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):

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.

Copy Message Modal

The fields to edit for the Copy Message modal are as follows:

Field
Description
Value

Your Copy Message modal should look like this:

Click Copy.

You will be redirected to the Details page of the newly created ResolveIncident Message.

Bond Fields

Navigate to Message > Bond.

The Bond fields to be edited are as follows:

Field
Description
Value

Your Bond form should look like this:

Navigate to Outbound > Trigger.

Outbound Trigger Fields

The Outbound Trigger (as required)* fields to be edited are as follows:

Field
Description
Value

*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:

Click Save.

We are now ready to configure the Fields for our ResolveIncident Message.

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'

Outbound condition*

The script that must be met for the message to be processed. Use current to get access to the triggering record.

[Blank]

Test ResolveIncident

Follow these steps to test the ResolveIncident Message.

Resolve the Incident

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:

View the Bond

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)

View the Transaction

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 >

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)

Stages:

  • Direction: 'Outbound' & 'Inbound'

  • Message: 'ResolveIncident' & 'Receipt'

  • Internal reference: < ServiceNow ticket reference > (Same as 'Document')

  • External reference: < External system's ticket reference >

View the Stage

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:

Stage details:

  • Direction: 'Outbound'

  • External reference: < External system's ticket reference >

  • Internal reference: < ServiceNow ticket reference >

  • Snapshot: < Snapshot record reference >

Mapped Staged Data fields:

  • close_code: < Your Resolution code >

  • close_notes: < Your Resolution notes >

  • state: '6'

View the HTTP Request

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:

HTTP Request details:

  • Integration: < Your Integration >

  • Connection: < Your Connection >

  • Transaction: < Your Transaction >

  • Message: 'ResolveIncident'

Response details:

  • Status code: '200'

  • Response headers: < The header of the response being received >

  • Response payload: < The payload of the response being received >

Compare with the External System's Incident

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'

Resolution code: < Your Resolution code >

Resolution notes: < Your Resolution notes >

Navigate to the Notes tab.

Your Notes tab should look like this:

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.

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)

  • Message: 'ResolveIncident'

  • Transaction: < Your Transaction >

  • Integration: < Your Integration >

  • 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 >

  • State

    The Incident lifecycle state.

    'Resolved'

    Resolution code

    The Incident resolution code.

    <Your Resolution code>

    Resolution notes

    The Incident resolution notes.

    <Your Resolution notes>

    ResolveIncident Fields

    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.

    Click on the ellipsis to the right of the incident.short_description Field & click Delete.

    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.

    Field: incident.state (Message level)

    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:

    Field
    Description
    Value

    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.

    Fields & Field Maps

    The table below lists the Incident record field elements we will map and the relevant Field Maps required to configure each Field record.

    Incident Field
    Field Map

    *Field map: Values may vary (dependent on your configuration of the copies). Choose the copy Field Maps you created earlier.

    Field: incident.close_code (Message level)

    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:

    Field
    Description
    Value

    *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.

    Field: incident.close_code (Integration level)

    You 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.

    Field: incident.close_notes

    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:

    Field
    Description
    Value

    *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:

    Submit the record.

    You will be redirected back to the Fields page of the ResolveIncident Message.

    Build

    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:

    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:

    Message Scripts

    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 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]

    Element

    The field on the source/target table this Field record is mapped to.

    'Resolution code'

    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>

    Mandatory

    Set to true to make mandatory.

    <true>

    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]

    Element

    The field on the source/target table this Field record is mapped to.

    'Resolution notes'

    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>

    Mandatory

    Set to true to make mandatory.

    <true>

    Active

    Set to true to create a Message level Field record from its Integration level counterpart.

    <true>

    close_code

    'IG - Choice'*

    close_notes

    'IG - 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>

    Message*

    The Message this Field record is linked with.

    'ResolveIncident'

    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>

    Field map

    Field map

    //===== [ws] Begin Unifi Auto Generated Code =====//
    
    /*
     * This code (between the Begin and End comments) is generated from the
     * Field and Field mapping records which are configured as part of the integration.
     *
     * All code either above or below the comments will be automatically maintained
     * through the build cycle.
     *
     * WARNING: Do not edit the Begin or End comments.
     */
    
    (New auto-generated code will appear here)
    
    //===== [ws] End Unifi Auto Generated Code =====//
    
    (Old pre-existing code will appear here)