# 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-MRK_CVyqNgcr63To2_w%2F-MRL1oVXzK5oqGSlp5gS%2FV2%20-%20Test%20Update%20Message%201.png?alt=media\&token=1d8b2ce9-5b37-4ded-9cea-b26f4c7ce3e8)

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-MRK_CVyqNgcr63To2_w%2F-MRL273gvTF5XZ0ZF-80%2FV2%20-%20Test%20Update%20Message%202.png?alt=media\&token=28cbd4e6-ba69-415a-b1c3-0953f72e4e42)

## 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-MRK_CVyqNgcr63To2_w%2F-MRL2HrqP4zB2IN63uKS%2FV2%20-%20Test%20Update%20Message%203.png?alt=media\&token=2bfd557c-0d6c-4a88-8d9b-c5c55afb6b08)

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-MRK_CVyqNgcr63To2_w%2F-MRL2vEwZsjoDz0CqhGV%2FV2%20-%20Test%20Update%20Message%204.png?alt=media\&token=1f5ddad4-b227-4c0a-87d2-dd1b5e045bc5)
{% 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-MRK_CVyqNgcr63To2_w%2F-MRL3EL--rce3YZnmKHP%2FV2%20-%20Test%20Update%20Message%204b.png?alt=media\&token=f68c5e9f-5c1d-4d28-b912-ec3ad383e2c8)
{% 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-MRK_CVyqNgcr63To2_w%2F-MRL3h5_iMuKHTmJzYUw%2FV2%20-%20Test%20Update%20Message%205.png?alt=media\&token=09402786-b8cf-40d9-bb1f-d252cc98dd8d)

![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRK_CVyqNgcr63To2_w%2F-MRL3lFW2XgFVdzCMRt0%2FV2%20-%20Test%20Update%20Message%205b.png?alt=media\&token=a0195465-1b16-4025-b4b4-86dfa4e0e60c)

{% 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://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRK_CVyqNgcr63To2_w%2F-MRL4FvLww202wFnDz1w%2FV2%20-%20Test%20Update%20Message%206.png?alt=media\&token=636c1d52-24e4-4450-b177-87f7b951fb62)

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-MRK_CVyqNgcr63To2_w%2F-MRL4Q8o9h7qlwOZvJne%2FV2%20-%20Test%20Update%20Message%207.png?alt=media\&token=aae24c27-b06a-47c3-bfec-17fd002e757e)

## 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-MRK_CVyqNgcr63To2_w%2F-MRL5IjNhgtoPJL6QEzR%2FV2%20-%20Test%20Update%20Message%208.png?alt=media\&token=68dd3589-a5a5-489f-8eab-9254d28de0b8)
{% endtab %}

{% tab title="Second Ticket" %}
![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRK_CVyqNgcr63To2_w%2F-MRL5N3qrvuvfJkvKVB4%2FV2%20-%20Test%20Update%20Message%209.png?alt=media\&token=67f8e318-97f2-4568-b618-4b9a51ce85e8)
{% 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://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRK_CVyqNgcr63To2_w%2F-MRL5a_zX8D13PGBPbQ3%2FV2%20-%20Test%20Update%20Message%2010.png?alt=media\&token=dfd2a1c9-17c9-4698-b80e-ae048a43a781)

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-MRK_CVyqNgcr63To2_w%2F-MRLAZkToNoXf3sekyk9%2FV2%20-%20Test%20Update%20Message%2011.png?alt=media\&token=abab9b65-7672-4d71-aad6-2c7d87ef428b)
{% 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-MRK_CVyqNgcr63To2_w%2F-MRLAjZuUjKZWhwy4yi9%2FV2%20-%20Test%20Update%20Message%2011b.png?alt=media\&token=31bf0365-ad22-4fd7-a6d3-948ae0dc0c91)
{% 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-MRK_CVyqNgcr63To2_w%2F-MRLBTuo-Scum8NdkLHK%2FV2%20-%20Test%20Update%20Message%2012.png?alt=media\&token=44750d84-8172-4685-bda1-b5e00baca8af)

![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRK_CVyqNgcr63To2_w%2F-MRLBY_4F85IEjk6bxbV%2FV2%20-%20Test%20Update%20Message%2013.png?alt=media\&token=84f1a947-a59d-45fd-80dd-2f4bafe9ccd7)
{% endtab %}

{% tab title="Second Ticket" %}
![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRK_CVyqNgcr63To2_w%2F-MRLBnxcTrcwhFg5rVpv%2FV2%20-%20Test%20Update%20Message%2014.png?alt=media\&token=f4fad5b8-7cfc-4c53-b8ca-03ccec58607d)

![](https://796541950-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-MQBk35gIi557UHt7QlJ%2F-MRK_CVyqNgcr63To2_w%2F-MRLBre-iHYHRxUJjO19%2FV2%20-%20Test%20Update%20Message%2015.png?alt=media\&token=85c4ac25-41c7-426b-b231-34c505e25c50)
{% 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.
