# removeCorrelationInfo

A Workflow Engine function that removes Situation Correlation Info (sigCorrelationInfo) for the specified service, and optionally for a specified external_id within that service. If no external_id is supplied (the parameter left blank), then all correlation info for the named service for the Situation is removed (allowing a replacement or update without knowing the currently associated external_id).

This action can be used in conjunction with the addCorrelationInfo action to create a replaceCorrelationInfo workflow, removing sigCorrelationInfo and adding a new item.

This function is available for Situation workflows only.

## Arguments

Workflow Engine function removeCorrelationInfo takes the following arguments:

Name

Required

Type

Description

serviceName

yes

string

The name of the correlated service (example: ServiceNow).

externalId

no

string

The external_id within the service to remove.

## Example

A Situation has an existing trouble ticket associated with it, and this needs to be updated to a new ticket number.

If the existing Correlation data for the Situation (taken from the Graze API call getSigCorrelationInfo) was:

[
{
"external_id": "INC1234569",
"sig_id": 200,
"service_name": "ServiceNow",
"properties": "{\"service_name\":\"ServiceNow\",\"external_id\":\"INC1234569\"}"
}
]

We can see that Situation 200 has an existing Incident (INC1234569) associated with it from ServiceNow. If we want to update this with a new Incident we can do the following:

• Action 1 : removeCorrelationInfo

• serviceName : “ServiceNow”

• externalId : <leave blank>

• serviceName : “ServiceNow”

• externalId : \$(workflowContext.ticketId)

To initiate this workflow use the Graze endpoint sendToWorkflow with the following payload:

{
"engine_name" : "Situation Inform Engine",
"workflow_name" : "Replace ServiceNow ticket",
"sitn_id" : 200,
"context" : {
"serviceName" : "ServiceNow",
"ticketId" : "INC999999999"
}
}

This replaces the current Incident (INC1234569) with the new ticket. After the workflow runs, the Correlation Info for the Situation has the new Incident number associated.

[
2  {
3    "external_id": "INC999999999",
4    "sig_id": 200,
5    "service_name": "ServiceNow",
6    "properties": "{\"service_name\":\"ServiceNow\",\"external_id\":\"INC999999999\"}"
7  }
8]

### Note

In addition to the above, it may also be necessary to update any Situation attributes to reflect this change (such as with the addCustomInfoValue action).

NOTE: The serviceName argument may also be used as a regular expression using the /<expression/> syntax. If the correlation info matches the pattern, it is removed.

For example, to remove all correlation info associated with the MSTeams integration, this pattern could be used:

/MSTeams.*/

Note that regular expressions are case insensitive.