copyOnMerge

A Workflow Engine function that copies data from child Situations to the parent Situation when a manual merge is performed. Data is copied from any available source field to a target custom_info field. Core fields cannot be modified by this action; the target field will always be custom_info.<target_field>.

This function is available as a feature of the Add-ons v2.3.5 download and later.

This function is available for Situation workflows only.

Back to Workflow Engine Functions Reference.

Arguments

Workflow Engine function copyOnMerge takes the following arguments:

Name

Required

Type

Description

sourceField

yes

string

The source field in the child Situations to copy from.

targetField

yes

string

The target field to copy the data to. This is always under custom_info and is always a list. There is no need to put custom_info in the parameter.

Example

The following example demonstrates typical use of Workflow Engine function copyOnMerge.

Given two Situations with existing Incident numbers stored under custom_info.ticketing.ticketNumber:

Screen_Shot_2021-06-11_at_4_02_22_PM.png
Screen_Shot_2021-06-11_at_4_03_20_PM.png

To copy this data to the parent when these are merged, use the following workflow:

  • Action 1: sigActionFilter

    • actionTypes: [ “Created By Merge” ]

  • Action 2: copyOnMerge

    • sourceField : custom_info.ticketing.ticketNumber

    • targetField : ticketing.childTickets

{"sourceField":"custom_info.ticketing.ticketNumber","targetField":"ticketing.childTickets"}

This merged Situation results in the following custom_info, containing both entries from the child Situations:

Screen_Shot_2021-06-11_at_4_14_09_PM.png
 "custom_info": {
2        "ticketing": {
3            "childTickets": [
4                "INC123456",
5                "INC123457"
6            ]
7        }
8    }