UpdateIncident Fields
We will utilise the Field & Field Map records to configure the Message Scripts for the UpdateIncident Message.
Last updated
We will utilise the Field & Field Map records to configure the Message Scripts for the UpdateIncident Message.
Last updated
The 'incident.short_desccription' (Integration level) Field record should already be in place (i.e. with Active set to false). Creating the Message level counterpart is now easier than ever.
From the UpdateIncident page, navigate to Message > Fields.
Find the incident.short_description (Integration level) Field & set Active to true.
The 'Build Integration' button becomes visible in the banner and 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).
By simply setting the Active flag to true on the Integration level Field record listed on the Message, Unifi has automatically created the Message level counterpart. The Integration level record still exists (and can be seen when you click on the 'Fields' icon to navigate to the Fields page), but is no longer visible in the list view on the Message because the Message level record has been created.)
Hints & Tips: Unifi automatically creates Integration level Fields when we first create the Message level equivalent records; those Integration level Fields are visible on the Fields list of the Messages we subsequently create. Therefore, if a Field is required for multiple Messages, create it once for the first Message and then simply set active to true for its Integration level counterpart from the Fields list of each of the relevant Messages that Field is required on.
We will now configure Field records for two other Incident record field elements.
The table below lists the Incident fields above and the relevant Field Maps required to configure each Field record.
Incident Field | Field Map |
---|---|
comments | 'PI - String'* |
work_notes | 'PI - String'* |
We have chosen String type here because we are integrating with the table API. This will return the contents of those fields as a string value. If we were integrating Unifi to Unifi we may use a Journal field type which would return an array of comments objects with "text", "created_on", "created_by" & "published" elements.
*Field map: Values may vary (dependent on your configuration of the copies). Choose the copy Field Maps you created earlier.
Because the incident.comments Field record is the same 'type' (IS - String) & the majority of the settings are the same as the previously configured Field, it will be quicker to copy the incident.short_description Field & make a few minor changes.
Click the ellipsis next to the incident.short_description Field record & click Copy.
The fields to edit for the Copy Field modal are as follows:
Field | Description | Value |
---|---|---|
Element | The field on the source/target table this Field record is mapped to. | Additional comments |
Property* | The property in the payload the data will be written to. | Automatically populated |
Description | Describe what this field is for and any specific details that might help you in future. | 'The incident's comments' |
*This field is automatically populated.
Your Copy Field modal should look like this:
Click Copy.
You will be redirected to the Details page of the newly created incident.comments Field record.
It will again be quicker to copy the previously configured incident.comments Field & make a few minor changes.
To quickly navigate back to the UpdateIncident Message, click the 'Preview' icon next to the Message field on the Details page of newly created incident.comments Field record.
Navigate to Message > Fields.
Click the ellipsis next to the incident.comments Field record & click Copy.
The fields to edit for the Copy Field modal are as follows:
Field | Description | Value |
---|---|---|
Element | The field on the source/target table this Field record is mapped to. | 'Work notes' |
Property* | The property in the payload the data will be written to. | Automatically populated |
Description | Describe what this field is for and any specific details that might help you in future. | 'The incident's work notes' |
*This field is automatically populated.
Your Copy Field modal should look like this:
Click Copy.
You will be redirected to the Details page of newly created incident.work_notes Field record.
Now that we’ve configured the Field records for the UpdateIncident message, we are ready to build our message scripts.
Navigate to the UpdateIncident Message, then navigate to Message > Fields.
The following Field records should now be in place for your UpdateIncident 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 may already be there (pre-existing code will be retained).
We will now examine our new, auto-generated Message Scripts.
Source to Stage:
Stage to Request:
We are now ready to Test the UpdateIncident Message.