CreateIncidentInbound Message

We will configure an inbound create message to process the data returned from the poll and create a new target record.

New Message Modal

Click the 'Messages' icon, then New.

The fields to be configured for the CreateIncidentInbound New Message modal are as follows:

#

Field

Description

Value

1

Message name

The message name that is unique for this integration.

'CreateIncidentInbound'

2

Type

The primary purpose of the message.

'Create'

3

Direction

The direction(s) this message is configured to support.

'Inbound'

4

Description

The description for this message and the requirement it is meeting.

<Your description>

Your CreateIncidentInbound New Message modal should look like this:

5) Click Submit and view to further configure the Message.

Response Fields

Navigate to Message > Response.

The Response fields to be configured are as follows:

#

Field

Description

Value

6

Response

The immediate synchronous response to this message.

<lookup: 'Response'>

*

Async

Turn this option on if you want inbound processing to occur asynchronously or this message is the first of an asynchronous message pair.

<true>

7

Async receipt

The asynchronous receipt to this message. Leaving this blank will cause the message to be processed async without sending a receipt.

<lookup: 'CreateIncidentInboundReceipt'>

*This field is automatically defaulted to true.

Your Response form should look like this:

8) Navigate to Message > Bond.

Bond Fields

The Bond fields to be configured are as follows:

#

Field

Description

Value

*

Bond ownership

Determine if the sender should own the bond or not in order for this message to be processed? Use 'Ignore' to process regardless of the owner flag. (Choices: Ignore, Must own, Must not own.)

'Ignore'

*

Bond condition type

The type of conditional check made on the bond. (None: no checks are made. State: checks against the state are made using the conditional checkboxes. Scripted: the 'Bond condition' script is used.)

'State'

9

Bond new

Process this message when a new bond is required.

<true>

*These fields are automatically populated.

Your Bond form should look like this:

10) Navigate to Inbound > Settings.

Inbound Settings Fields

The Inbound Settings fields to be configured are as follows:

#

Field

Description

Value

*

Bond reference method

Method of searching for and validating an existing bond for incoming messages.

'External'

11

Reference lookup script

The script containing functions for extracting internal and external references from the request payload.

Update the code in the Reference lookup script field so that it looks like the code below

*Bond reference method (defaulted to 'External' & not editable for Create type Messages):

Internal - lookup using the internal reference only.

External - lookup using the external reference only.

Both - lookup using both the internal and external references.

Bond reference method: The perspective of the available choices is in relation to the receiving instance i.e. Internal (internal reference) means the bonded ticket in our instance and External (external reference) means the bonded ticket in their instance. These settings define which values to lookup against to search for and validate whether or not a bond already exists.

In the case of a create type message (as per our requirement), it is defaulted to 'External' because there is not yet a bonded ticket in the receiving instance to reference (if we were to receive a create type message which referenced a bond that already existed it would be rejected because we don't want to create another bond for a record we've already seen ).

The code in the 'Reference lookup script' field should look like this:

var answer = {};

answer.getExternalMessageID = function (payload, request) {
  return '' + (payload.message.source_id || '');
};

answer.getInternalMessageID = function (payload, request) {
  return '' + (payload.message.target_id || '');
};

Reference lookup script: It’s important to identify which message an asynchronous receipt is replying to. This script extracts the transaction’s unique identifier.

In the case of an inbound create/update (as per our requirement) it would return their external message id (source id) to identify which transaction our asynchronous receipt belongs to. (In the case of an inbound asynchronous receipt it would return our internal message id (target id) to identify which transaction their asynchronous receipt belongs to.)

Your Inbound Settings form should look like this:

12) Navigate to Advanced > Script Editor.

Script Editor Fields

As well as being the place where Bond state & ownership are set, the Scripts are where the request processing and data mapping occurs.

Click on View > Inbound.

The Script Editor fields to be configured are as follows:

#

Field

Description

Value

13

Stage to Target (Inbound)

The script to run.

Replace the commented out instructions with the following code: bond.setOpen();

Scripts

In the current release, there is no OOTB Field Map record with which we can set the state on the Bond. We shall, therefore, script that manually. For more information , see the `Fields` & `Field Maps` pages in our technical documentation.

The code in the 'Stage to Target' script field should look like this:

bond.setOpen();

Your Script Editor fields should look like this:

14) Click Save.

15) Close the Script Editor to navigate back to the Message.

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

Last updated