sendTeamsAddedToIncident

A Workflow Engine function that sends a request to the corresponding outbound integration workflow to add a list of teams to the incident for the named service. By default, the teams to add are taken from the teamsAdded workflowContext key. You can override this by using the optional teamNames argument.

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

This function is available for alert and Situation workflows.

Back to Workflow Engine Functions Reference.Workflow Engine Functions Reference

Arguments

Workflow Engine function sendTeamsAddedToIncident takes the following arguments:

Name

Required

Type

Description

serviceName

yes

string

The name of the incident integration; has the value alertops.

instanceName

no

string

An instance name for integrations supporting multiple instances. Default to the first instance.

teamNames

no

string

A list of team names. Example: teamA, teamB

arguments

no

object

A JavaScript object that passes any additional arguments as context to the workflow and adds them to the existing workflow context.

Example

Within a Situation Delta workflow, this action can be preceded by the getTeamsAdded function. This function returns true if teams were added to a situation and have populated the teamsAdded workflowContext key with a list of teams.

If the forwarding behavior of the getTeamsAdded function is set to “Stop This Workflow”, the subsequent sendTeamsAddedToIncident function only runs when the workflow receives a Situation containing added teams.

To forward the team assignment to AlertOps, we can give the following arguments to the sendTeamsAddedToIncident function:

Argument Name

Argument Value

serviceName

alertops

instanceName

teamNames

arguments

Which the UI translates to:

{"serviceName":"alertops" }

This sends a Situation Inform message to the “Add Teams to AlertOps Incident” workflow in the Situation Integration WFE. This workflow contains a sendTeamsAddedToAlertOpsIncident function which uses the teamsAdded workflowContext key to retrieve the names of the new teams and forward a message to AlertOps.

Alternatively, if the sendTeamsAddedToAlertOpsIncident action were given the following arguments:

Argument Name

Argument Value

serviceName

alertops

instanceName

teamNames

TeamA, TeamB

arguments

Which the UI translates to:

{"serviceName":"alertops", "teamNames":"TeamA, TeamB" }

In this second example, the function sends a Situation Inform to the “Add Teams to AlertOps Incident” workflow in the Situation Integration WFE, but now the teamsAdded context key contains the list: [“TeamA”, “TeamB”], so these team names are used to send the update to AlertOps.