# Test UpdateIncidentInbound

To test our integration we will need some bonded tickets in the remote instance. If there aren't any already in place, then they'll need to be created.

## Create Test Incidents

In **native ServiceNow**, navigate to **Incident > Create New**.

The Incident fields to configure are as follows:

|  #  | Field             | Description                                          | Value                     |
| :-: | ----------------- | ---------------------------------------------------- | ------------------------- |
|  1  | Caller            | Person who reported or is affected by this incident. | \<Your Caller>            |
|  2  | Short description | A brief description of the incident.                 | \<Your Short description> |
|  3  | Description       | Detailed explanation on the incident.                | \<Your Description>       |

{% hint style="info" %}
Though the CreateIncident Message has been configured to map more than just the Short Description & Description fields, we have only filled these fields because that is all whe have included in the payload of our Poller.
{% endhint %}

*Your Incident form should look like this:*

![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRRCpoWKJnUmfL7aoVp%2F-MRRFDMyooM8KxBe2Nzb%2FV2%20-%20Test%20Update%20Message%201.png?alt=media\&token=1b796479-2084-4084-8d33-f674f32f7862)

4\) Note the Info Message confirming the CreateIncident Message is being sent to your Integration.

5\) Note the Bond is 'Open' and both the Internal & External reference are in place.

{% hint style="success" %}
Repeat as necessary so that there are two or three bonded tickets in the remote instance:
{% endhint %}

![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRRCpoWKJnUmfL7aoVp%2F-MRRFgJ8j3sggKNVU-6h%2FV2%20-%20Test%20Update%20Message%202.png?alt=media\&token=c12218f0-8c98-4334-88a4-faf82be28f68)

## Update from Originating Instance

**Update one** of the **bonded tickets** in the **originating instance** to cause the UpdateIncident Message to fire:

![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRRFlSPgXZ6ZrqjuYPO%2F-MRRTHDYLpN6MALO2Yjs%2FV2%20-%20Test%20Update%20Message%203.png?alt=media\&token=cdc91595-573e-450d-b358-a1d10963c974)

View the Transactions that have been sent. This can be done either in Native ServiceNow, or in the Unifi Operations Portal.

{% tabs %}
{% tab title="Native ServiceNow" %}
Navigate to **\[ws] Unifi > Transport > Transactions**.

![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRRFlSPgXZ6ZrqjuYPO%2F-MRRTyTF5WOJT-el_-UV%2FV2%20-%20Test%20Update%20Message%204.png?alt=media\&token=7574a085-22ef-46f3-80e8-93c4d86464dd)
{% endtab %}

{% tab title="Unifi Operations Portal" %}
Navigate to **\[ws] Unifi > Unifi Operations Portal**.

![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRRFlSPgXZ6ZrqjuYPO%2F-MRRU93fDLxU9JvjdXYI%2FV2%20-%20Test%20Update%20Message%204b.png?alt=media\&token=8f578920-c0ab-4236-a8d7-46fff2ad8b75)
{% endtab %}
{% endtabs %}

{% hint style="success" %}
We can see that the three CreateIncident messages & one UpdateIncident message have been sent. All are Complete & Accepted & display the relevant Incident & Bond numbers.
{% endhint %}

Confirm the Transaction has updated the **bonded ticket** in the **remote instance**:

![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRRFlSPgXZ6ZrqjuYPO%2F-MRRUTrvZNLiRHJZYYbu%2FV2%20-%20Test%20Update%20Message%205.png?alt=media\&token=a8b1f610-86af-46d5-a298-220c345e8694)

![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRRFlSPgXZ6ZrqjuYPO%2F-MRRUXHOo4ohu872J5iM%2FV2%20-%20Test%20Update%20Message%205b.png?alt=media\&token=3009fc90-d300-4f85-80a1-5b411351bbcd)

{% hint style="success" %}
We can see that the update has reached the bonded ticket (& that the correlation id matches the outbound Incident number)
{% endhint %}

## Poll for Updates

In **Unifi Integration Designer**, click on the **'Pollers' icon**. Navigate to & **open** **< Your Parent Poller >** *(created earlier)*.

Click **Execute Now**:

![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRRFlSPgXZ6ZrqjuYPO%2F-MRRV19RhCClKjP7jnTx%2FV2%20-%20Test%20Update%20Message%206.png?alt=media\&token=16b0246f-4f8b-47c5-9d4b-8b476239b9bc)

In **native ServiceNow**, navigate to **\[ws] Unifi > Polling > Poll Requests**. Click to **Open** & view the generated **Poll Request**. Confirm that no Incident was found (this is exactly as we expect because we are only polling for updates made by the remote instance):

![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRRFlSPgXZ6ZrqjuYPO%2F-MRRV7au1FVc3fgpczDo%2FV2%20-%20Test%20Update%20Message%207.png?alt=media\&token=b0695b88-d4ce-4502-9666-71185ca9f179)

## Update from Remote Instance

in the **remote instance**, **update two** of the **bonded tickets** in turn.

{% hint style="info" %}
Updates have been made to the Description field only. Correlation ID is highlighted for us to identify the correct bonded ticket).
{% endhint %}

{% tabs %}
{% tab title="First Ticket" %}
![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRRFlSPgXZ6ZrqjuYPO%2F-MRRVrNCGlD1ZmAjFfsu%2FV2%20-%20Test%20Update%20Message%208.png?alt=media\&token=404a84be-62b5-4939-8d14-ef24d978b24d)
{% endtab %}

{% tab title="Second Ticket" %}
![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRRFlSPgXZ6ZrqjuYPO%2F-MRRVy2-Aiffm0bTg0Lo%2FV2%20-%20Test%20Update%20Message%209.png?alt=media\&token=53309f98-91d2-4fec-b35b-8976b7c81fb6)
{% endtab %}
{% endtabs %}

## Poll for Updates

Back in the **originating instance**, navigate to & **open < Your Poller >**. Click **Execute Now**.

**Open** the **corresponding Parent Poll Request** & **confirm** that **both Incidents** were **found** (and *only* those) and that **subsequent child Poll Requests** were also **triggered**:

![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRRFlSPgXZ6ZrqjuYPO%2F-MRRW7cul0xY6kbV6rnn%2FV2%20-%20Test%20Update%20Message%2010.png?alt=media\&token=58d22de4-80cb-45e6-ae3e-3a5d9e673f2d)

Notice the Parent & Child Poll Requests:

![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRRFlSPgXZ6ZrqjuYPO%2F-MRRWHwW672wJKeR-lNm%2FV2%20-%20Test%20Update%20Message%2010b.png?alt=media\&token=692a8c43-378a-4fbd-8fed-5e0bb21f302a)

**Open** each of the **corresponding Child Poll Requests** & **confirm** that the **Message name** was **UpdateIncidentInbound**.

View the Transactions that have been sent. This can be done either in Native ServiceNow, or in the Unifi Operations Portal.

{% tabs %}
{% tab title="Native ServiceNow" %}
Navigate to **\[ws] Unifi > Transport > Transactions**.

![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRRFlSPgXZ6ZrqjuYPO%2F-MRRX-T6xtreE3-QEim9%2FV2%20-%20Test%20Update%20Message%2011.png?alt=media\&token=8e63eb35-a664-4b0b-81ce-66c9f1296958)
{% endtab %}

{% tab title="Unifi Operations Portal" %}
Navigate to **\[ws] Unifi > Unifi Operations Portal**.

![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRRFlSPgXZ6ZrqjuYPO%2F-MRRXBhB2B5dhvwB6vK1%2FV2%20-%20Test%20Update%20Message%2011b.png?alt=media\&token=922caf3a-ca65-4a17-9f07-3a225e82ac5d)
{% endtab %}
{% endtabs %}

{% hint style="success" %}
We can see that two UpdateIncidentInbound messages have been received. Both are Complete & Accepted & display the relevant Incident & Bond numbers.
{% endhint %}

Confirm the Transactions have updated the **bonded tickets** in the **originating instance**.

{% tabs %}
{% tab title="First Ticket" %}
![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRRFlSPgXZ6ZrqjuYPO%2F-MRRXZbwip5G_LVVkWJI%2FV2%20-%20Test%20Update%20Message%2012.png?alt=media\&token=179bad25-9b95-42ea-8164-fb92624e081d)

![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRRFlSPgXZ6ZrqjuYPO%2F-MRRXcQiv6yraUazmt_T%2FV2%20-%20Test%20Update%20Message%2013.png?alt=media\&token=f6c91784-b142-475b-93b0-ddce18f70ff4)
{% endtab %}

{% tab title="Second Ticket" %}
![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRRFlSPgXZ6ZrqjuYPO%2F-MRRYD7R4Hl-5Vs99jN3%2FV2%20-%20Test%20Update%20Message%2014.png?alt=media\&token=aef75069-d558-4863-a933-da5cb4eed709)

![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRRFlSPgXZ6ZrqjuYPO%2F-MRRYH_w7W_Ufij5UgF0%2FV2%20-%20Test%20Update%20Message%2015.png?alt=media\&token=ea19ddda-5e74-4479-9a82-b8c77928d76e)
{% endtab %}
{% endtabs %}

## Challenge

For completeness, to prove we are only querying and pulling back data from bonded records, update an incident in the remote system which isn't bonded (Correlation ID is empty) & run the Poller again.

What do you expect to happen?

Next, we shall test the **ResolveIncidentInbound** Message.
