isPrimaryTeamSet
A Workflow Engine function that returns true if the primary team for a Situation is set. You can optionally check the team name against the specified one. If the primary team has not been set, or does not match the specified name, the action returns false.
If the action returns true, adds the Team Name to workflowContext.primaryTeam
.
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 Situation workflows only.
Back to Workflow Engine Functions Reference.
Arguments
Workflow Engine function isPrimaryTeamSet
takes the following arguments:
Name | Required | Type | Description |
---|---|---|---|
| no | string | The name of a team to check the primary team against. |
Example
You can check if a Situation has a primary team set by not using the "teamName" parameter. If the primary team is set to any team name, the action returns true, returning false otherwise.
You can check if the primary team name matches a predefined team by using the teamName parameter. For example, to see if the primary team is "Networks:
teamName : Networks
The UI translates your settings to the following JSON:
{"teamName":"Networks"}
If the primary team is set to “Networks", isPrimaryTeamSet
returns true. If the primary team is not set or is not set to “Networks”, the action returns false.
If the action returns true, the primary team will be copied into the workflowContext under “primaryTeam” to allow the team name to be used in subsequent actions. For example, if a Situation Export has been set up, you could add the primaryTeam name to the payload.
Actions:
primaryTeamSet
: has the team been set?getPayload
: create a predefined payload.copyToPayload
: the key could be “primaryTeam” and the value would be a substitution from the workflowContext “$(workflowContext.primaryTeam)”.exportViaRest
: export to a predefined endpoint using the modified payload to include the primary team.