LogoLogo
AboutSupport
2.2
2.2
  • Unifi Documentation
  • Release
    • Release Notes
      • 2.1 Release Notes
      • 2.0 Release Notes
    • Hotfixes
    • Setup
  • Overview
    • Quick Tour
    • Supported Features
    • Application Module Overview
  • Integration Guides
    • Outbound Incident Guide
      • Getting Started
      • Process
      • Integration
      • Connection
      • Trigger
      • Create Scenario
        • CreateIncidentResponse Message
        • CreateIncidentResponse Fields
        • CreateIncident Message
        • CreateIncident Fields
        • Test CreateIncident
      • Update Scenario
        • Response Message
        • UpdateIncident Message
        • UpdateIncident Fields
        • Test UpdateIncident
      • Resolve Scenario
        • ResolveIncident Message
        • ResolveIncident Fields
        • Test ResolveIncident
      • Build - Integration Level
      • Conclusion
    • Bidirectional Asynchronous Incident Guide
      • Getting Started
      • Process
      • Web Service
      • Integration
      • Connection
      • Trigger
      • Create Scenario
        • Response Message
        • CreateIncidentReceipt Message
        • CreateIncidentReceipt Fields
        • CreateIncident Message
        • CreateIncident Fields
        • Test CreateIncident
      • Update Scenario
        • Receipt Message
        • UpdateIncident Message
        • UpdateIncident Fields
        • Test UpdateIncident
      • Resolve Scenario
        • ResolveIncident Message
        • ResolveIncident Fields
        • Test ResolveIncident
      • Build - Integration Level
      • Build the Other Half
        • Move the Integration
        • Reconfigure the Connections
      • Conclusion
    • Incident Update Poller Guide
      • Polling
        • Poll Processor
        • Poller
      • Inbound Message
        • UpdateIncidentInbound Message
        • UpdateIncidentInbound Fields
      • Message Identification
      • Bond Identification
        • Edit Incident Form
        • Edit CreateIncident Message
      • Test Update Poll
      • Conclusion
    • Incident Multiple Message Poller Guide
      • Polling
        • Poll Processor
        • Poller
      • Inbound Messages
        • ResolveIncidentInbound Message
        • ResolveIncidentInbound Fields
      • Testing
        • Test UpdateIncidentInbound
        • Test ResolveIncidentInbound
      • Conclusion
    • Incident Create Poller Guide
      • Polling
        • Connection Variables
        • Poll Processor
        • Poller
      • Messages
        • CreateIncidentInboundReceipt Message
        • CreateIncidentInboundReceipt Fields
        • CreateIncidentInbound Message
        • CreateIncidentInbound Fields
      • Build - Integration Level
      • Test Create Poll
      • Conclusion
    • Incident Parent and Child Poller Guide
      • Polling
        • Connection Variables
        • Child Poll Processor
        • Child Poller
        • Parent Poll Processor
        • Parent Poller
      • Inbound Messages
      • Testing
        • Test UpdateIncidentInbound
        • Test ResolveIncidentInbound
      • Conclusion
    • Incident Attachment Poller Guide
      • Polling
        • Connection Variables
        • Edit Endpoint URLs
        • Get Attachment Poll Processor
        • Get Attachment Poller
        • Select Attachments Poll Processor
        • Select Attachments Poller
        • Edit Child Poll Processor
        • Edit Child Update Poller
      • Messages
        • AddAttachmentInbound Message
      • Testing
        • Test Outbound Scenarios
        • Test CreateIncidentInbound
        • Test UpdateIncidentInbound
        • Test ResolveIncidentInbound
        • Test AddAttachmentInbound
      • Conclusion
  • Feature Guides
    • Packager Feature Guide
      • Instructions
    • Error Handling Tools Feature Guide
      • Retry
      • Replay
      • Ignore
      • Repair
      • Pause and Resume
  • Bonding
    • Bonds
    • Bonded Attachments
  • Transport
    • Transport Data Flow
    • Transactions
    • Stages
    • HTTP Requests
    • Response Actions
  • Configuration
    • Processes
    • Integrations
    • Connections
    • Messages
    • Message Scripts
    • Fields
    • Field Maps
    • Event Actions
  • Polling
    • Pollers
    • Poll Processors
    • Poll Requests
    • Large Response Payloads
  • Administration
    • Activity Logs
    • Data Stores
    • Properties
    • Scheduled Scripts
    • System Logs
    • Self-test
  • Scripting
    • Variables
    • Snippets
  • Attachments
    • Attachment Handling
    • Multipart Form Data
Powered by GitBook
On this page
  • Copy Field Maps
  • Copy Field Map Modal
  • Field: result.sys_id
  • Build
  • Message Scripts

Was this helpful?

Export as PDF
  1. Integration Guides
  2. Outbound Incident Guide
  3. Create Scenario

CreateIncidentResponse Fields

We will utilise the Field & Field Map records to configure the Message Scripts for the CreateIncidentResponse Message.

PreviousCreateIncidentResponse MessageNextCreateIncident Message

Last updated 4 years ago

Was this helpful?

Copy Field Maps

It is worth copying all relevant OOTB Field Maps as are necessary for your integration before using any of them in your Field Records - thereby mitigating the risk of any potential issues with future upgrades.

The Field Map we shall use for our CreateIncidentResponse Field record is:

  • Source Reference

To copy the Source Reference Field Map, navigate to the 'Field Maps' icon.

1) Click on the ellipsis to the right of the Source Reference Field Map & click Copy.

Copy Field Map Modal

The fields to edit for the Copy Field Map modal are as follows:

#

Field

Description

Value

2

Name*

The name of your field map. (If left unedited, it will append the word 'Copy' to the existing name.)

<Your Name>

*Name: We have chosen to prefix the existing Field Map Name with the initials of our Integration (you are free to choose any appropriate means of identifying/differentiating your copy).

Your Copy Field Map modal should look like this:

Integration should be automatically populated.

3) Click Copy.

You will be redirected to the Details page of the newly created Field Map.

Field: result.sys_id

In Unifi Integration Designer, from the CreateIncidentResponse page, navigate to Message > Fields. Click New.

The fields to be configured for the sys_id New Field modal are as follows:

#

Field

Description

Value

*

Message

The Message this Field record is linked with.

'CreateIncidentResponse'

4

Description

Describe what this field is for and any specific details that might help you in future.

'Extract returned sys_id & store in stage.external_reference'

*

Active

Set to true to use this Field record for processing.

<true>

5

Field map

The Field Map this Field record is linked with.

'IS - Source Reference'**

6*

Map to field

Use this Field record to represent a field on a source/target table.

<false>

7

Path

Where in the payload the data will be placed.

'result'

8

Property*

The property in the payload the data will be written to.

'sys_id'

*

Inbound

Set to true to use for inbound Messages.

<true>

9*

Outbound

Set to true to use for outbound Messages.

<false>

*These fields are automatically defaulted to true, or automatically populated.

**Field map: Value may vary. Choose the copy Field Map you created for your Integration.

*Property: We are setting 'sys_id' as the property because that is what is required by the table API. If it were possible, it would better to use something more meaningful, like the Number of the ticket integrated with, as this aids in debugging.

The 'result.sys_id' New Field modal should look like this:

10) Submit the record.

You will be redirected back to the Fields page of the CreateIncidentResponse Message.

Build

Now that we’ve configured the Field records for the CreateIncidentResponse message, we are ready to build our message scripts.

The following Field record should now be in place for your CreateIncidentResponse messsage:

11) Click on Build Message.

You will see the 'Message build successful' Info Message.

12) Navigate to Advanced > Script Editor to view the auto-generated code.

Your Script Editor fields should look like this:

Message Scripts

The newly auto-generated code will appear between a Begin & End Comment immediately prior to any code that was already there.

//===== [ws] Begin Unifi Auto Generated Code =====//

/*
 * This code (between the Begin and End comments) is generated from the
 * Field and Field mapping records which are configured as part of the integration.
 *
 * All code either above or below the comments will be automatically maintained
 * through the build cycle.
 *
 * WARNING: Do not edit the Begin or End comments.
 */

(New auto-generated code will appear here)

//===== [ws] End Unifi Auto Generated Code =====//

(Old pre-existing code will appear here)

We will now examine our new, auto-generated Message Scripts.

Payload to Stage:

//===== [ws] Begin Unifi Auto Generated Code =====//

/*
 * This code (between the Begin and End comments) is generated from the
 * Field and Field mapping records which are configured as part of the integration.
 *
 * All code either above or below the comments will be automatically maintained
 * through the build cycle.
 *
 * WARNING: Do not edit the Begin or End comments.
 */

x_snd_eb.ws_console.execute("Mapping result.sys_id [x_snd_eb_field.do?sys_id=a7653549dbf9985094dbd7795e9619bc]", function () {
  log.debug("Field map: IS - Source Reference [x_snd_eb_field_map.do?sys_id=c930653cdb7d585094dbd7795e96199a]");
  payload = payload || {};
  payload.result = payload.result || {};
  var $payload = payload.result;

  stage.external_reference = '' + ($payload.sys_id || '');

});

if (x_snd_eb.ws_console.has_error) {
  var errors = x_snd_eb.ws_console.get({type: 'error'});
  if (errors.length) {
    throw errors[0];
  }
}

//===== [ws] End Unifi Auto Generated Code =====//

Stage to Target:

bond.setOpen();

Both the stage & bond external reference are being set to the sys id only because we are integrating with the table API and that's what it requires. If possible, it is better to use something more meaningful, like the Number of the ticket integrated with, as this aids in debugging.

Next, we will configure the CreateIncident Message.

Feature Alert: In the picture above you will notice that a 'Build Integration' button has appeared in the banner at the top of the page. Whenever a change is made to a Field record that is associated to a Message (whether that is being created, updated, or deleted) the button will be available and acts as a visual reminder that changes have been made and Message Script(s) need to be built. We will talk more about this feature in the page.

The code we had previously added when configuring our Message as per the '' page is still in place.

Build Integration Level
CreateIncidentResponse Message