Skip to main content

copyFromEventToAlert

A Workflow Engine function that allows you to copy custom_info fields from an incoming event to the existing alert that the event would de-duplicate to. You can use the function to partially update custom info on an alert de-duplication. This can be used in the global custom info update preference configured within the AlertBuilder.

This action takes a list of fields to selectively copy between the event and alert. These fields have to be under custom_info .

The custom_info prefix is optional in the field list. For example, the following two fields lists would have the same functionality: copying custom_info.location.city from the event to custom_info.location.city in the associated alert:

[ "custom_info.location.city" ]
[ "location.city" ]

This action is useful when an incoming event’s custom_info may change over the course of the alert’s lifecycle and you need the updated values in subsequent functionality. For example to satisfy a workflow entry filter or to satisfy a tirgger or exclusion filter for a recipe.

If you want to merge the contents of custom_info upon every event de-duplication, then use the Alert Builder global custom_info merge. See the AlertBuilder Moobot comments, or contact your Moogsoft technical resource for more information.

The action returns true if all attempted updates are successful and false if one or more attempted updates fail. If the event has no associated alert the action returns false. For example, if the event will create a new alert.

Note

This action is a direct key replacement whereby values are replaced rather than merged. If the event is an array or object, it overwrites any existing alert value for the same key.

Note

This action results in an AlertUpdate issued for each field. Moolets that are event_handler-driven will receive each of these updates.

This function is available as a feature of the Add-ons v2.1 download and later. See Install Moogsoft Add-ons for information on how to upgrade.

This function is available for event workflows only.

Back to Workflow Engine Functions Reference.

Arguments

Workflow Engine function copyFromEventToAlert takes the following arguments:

Name

Required

Type

Description

fields

yes

object

The list of custom_info fields to selectively copy from the event to the alert. These do not need to be specified as custom_info.field, but can be.

Example

To selectively update an alert’s custom info with the values from an incoming event for custom_info.location.city, custom_info.supportGroup and custom_info.applications:

  • fields : [ “location.city” , “applications” ]

The UI translates your settings to the following JSON:

{"fields":["location.city","applications","custom_info.suppportGroup"]}

If the fields exist in the event, their values will be copied into the associated alert.