Skip to main content

getSimilarSituationDetails

A Workflow Engine function that gets the most recent, highest similarity situation containing all the listed fields and, optionally, matches against correlation info using the specified service_name. The requested details will be added to the workflowContext key situationDetails.

This function uses the Situation Similarity utility provided with the Workflow Engine to calculate similarity between .5 (50% similar) and 1 (100% similar). The Situation Similarity requires some configuration. You can find the configuration file at: $MOOGSOFT_HOME/config/SimilarSigConfig.conf

  • Verify the Graze API credentials are valid.

  • Verify the webhost is correct if the UI runs on a different host than Moogfarmd.

The optional service_name argument will filter similar situations to those containing Situation Correlation Info for the specified service.

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

This function is available for Situation workflows only.

Back to Workflow Engine Functions Reference.

Arguments

Workflow Engine function getSimilarSituationDetails takes the following arguments:

Name

Required

Type

Description

fields

yes

object

An array of fields to test for and return.

service_name

no

string

Optionally, restrict to situations notified to the specified service, ex. "servicenowmgmt". This searches for matching Situation Correlation Info and adds it to the workflowContext under: situationDetails.related

Example

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

When a new situation is created, we want to find the highest similarity situation notified to ServiceNow and add the incident reference custom_info.previous_incident. To do this we add the following actions to a “Situations Workflow” workflow:

Action Name

Get situation details

Function

getSimilarSituationDetails

Arguments

fields

["custom_info.inc","description"]

service_name

ServiceNowMgmt

Action Name

Add to situation

Function

copyFromContext

Arguments

from

situationDetails

to

custom_info.previous_incident

Given a matching situation 87 that was notified to ServiceNow as incident INC0010004, this would populate custom_info.previous_incident with:

{
  "sig_id": 87,
  "similarity": 1,
  "related": {
    "external_id": "e95930e0475c25102db921baf36d43a7",
    "sig_id": 87,
    "service_name": "ServiceNowMgmt",
    "properties": "{\"service_name\":\"ServiceNowMgmt\",\"external_id\":\"e95930e0475c25102db921baf36d43a7\"}"
  },
  "custom_info.inc": "INC0010004",
  "description": "Alerts from a similar source "
}

The related key is only populated when using the service_name argument. It contains the Situation Correlation Info for the service - in this case, ServiceNowMgmt.