# 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                     |
| ----------------- | ---------------------------------------------------- | ------------------------- |
| Caller            | Person who reported or is affected by this incident. | \<Your Caller>            |
| Short description | A brief description of the incident.                 | \<Your Short description> |
| 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://content.gitbook.com/content/fbSELbHwB4GcLuDcZMCU/blobs/tSXGT92RDaXhOPNsX5UA/immpg-test-updateincidentinbound-1.png)

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

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://content.gitbook.com/content/fbSELbHwB4GcLuDcZMCU/blobs/psfVnbbWFdm5sVtX52f4/immpg-test-updateincidentinbound-2.png)

## Update from Originating Instance

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

![](https://content.gitbook.com/content/fbSELbHwB4GcLuDcZMCU/blobs/RZC9cZbyUT0xmyfcVXeh/immpg-test-updateincidentinbound-3.png)

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

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

![](https://content.gitbook.com/content/fbSELbHwB4GcLuDcZMCU/blobs/gauIJe8lUQgjeHrVei5F/immpg-test-updateincidentinbound-4.png)
{% endtab %}

{% tab title="Unifi Operations Manager" %}
Navigate to **Unifi > Unifi Operations Manager**.

![](https://content.gitbook.com/content/fbSELbHwB4GcLuDcZMCU/blobs/EuRVxSYb4R1ZfKYc9nCG/immpg-test-updateincidentinbound-5.png)
{% 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://content.gitbook.com/content/fbSELbHwB4GcLuDcZMCU/blobs/f24WphVvNsJ3QRpXcmqx/immpg-test-updateincidentinbound-6.png)

![](https://content.gitbook.com/content/fbSELbHwB4GcLuDcZMCU/blobs/2VJyVcPnNIy3iU4AK3Mo/immpg-test-updateincidentinbound-7.png)

{% 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 Poller >** *(created earlier)*. Click **Execute Now**:

![](https://content.gitbook.com/content/fbSELbHwB4GcLuDcZMCU/blobs/ZLhwWDTnrmsabvfxYNBi/immpg-test-updateincidentinbound-8.png)

In **native ServiceNow**, navigate to **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://content.gitbook.com/content/fbSELbHwB4GcLuDcZMCU/blobs/uDgTv3qajXlHt4AWXqZl/immpg-test-updateincidentinbound-9.png)

## 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://content.gitbook.com/content/fbSELbHwB4GcLuDcZMCU/blobs/G6LuQk0sT6A09AL2fi4Z/immpg-test-updateincidentinbound-10.png)
{% endtab %}

{% tab title="Second Ticket" %}
![](https://content.gitbook.com/content/fbSELbHwB4GcLuDcZMCU/blobs/Ko92ajqkxOnkaqA1XCc8/immpg-test-updateincidentinbound-11.png)
{% endtab %}
{% endtabs %}

## Poll for Updates

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

**Open** the **corresponding Poll Request** & **confirm** that **both Incidents** were **found** (and *only* those) and that the **Message name** was **UpdateIncidentInbound**:

![](https://content.gitbook.com/content/fbSELbHwB4GcLuDcZMCU/blobs/PyHxscCqjnajucU7sCmW/immpg-test-updateincidentinbound-12.png)

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

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

![](https://content.gitbook.com/content/fbSELbHwB4GcLuDcZMCU/blobs/yK8DRYyNHfXtpnrxJh9V/immpg-test-updateincidentinbound-13.png)
{% endtab %}

{% tab title="Unifi Operations Manager" %}
Navigate to **Unifi > Unifi Operations Manager**.

![](https://content.gitbook.com/content/fbSELbHwB4GcLuDcZMCU/blobs/AXLFIc41RILLU6dj0gnO/immpg-test-updateincidentinbound-14.png)
{% 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://content.gitbook.com/content/fbSELbHwB4GcLuDcZMCU/blobs/mTwjbvHXve0FHvN8fx7r/immpg-test-updateincidentinbound-15.png)

![](https://content.gitbook.com/content/fbSELbHwB4GcLuDcZMCU/blobs/gUp7VVMAjhzdy2rvdjTE/immpg-test-updateincidentinbound-16.png)
{% endtab %}

{% tab title="Second Ticket" %}
![](https://content.gitbook.com/content/fbSELbHwB4GcLuDcZMCU/blobs/IvI4QuHKYdk2d3Zeg8DT/immpg-test-updateincidentinbound-17.png)

![](https://content.gitbook.com/content/fbSELbHwB4GcLuDcZMCU/blobs/BXhlHFuGnWXgT3IMH15V/immpg-test-updateincidentinbound-18.png)
{% 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.
