Skip to main content

getTeamDetails

A Workflow Engine function that retrieves details for the specified Team, the Primary Team, or all Teams associated with a Situation, and also collects the email addresses of the team members. It writes the results to the workflow context under workflowContext.team_details.<team_name>. The action also compiles a consolidated list of all selected team email addresses and stores it in workflowContext.team_details.all_team_emails.

The action returns true when it finds team details. If it does not find any details, it returns false.

Note

The action retrieves email addresses only for the first 20 users in each team.

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

This function is available for Situation workflows only.

Back to Workflow Engine Functions Reference.

Arguments

Workflow Engine function getTeamDetails takes the following arguments:

Name

Required

Type

Description

teamName

yes

string

One of the following:

  • ALL: retrieves details for all teams associated with the Situation.

  • Primary: retrieves details for the team assigned as the primary team. If no primary team is assigned, the action returns false.

  • <team_name>: retrieves details for the specified team when a team name is supplied. If the team is not assigned to the Situation, the action returns false.

Example

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

To send an email to all members of the primary team for a Situation:

In the Situation Workflow, create a new workflow with the following actions:

  • getTeamDetails:

    • teamName : primary

  • sendEmail:

    • emailConfig : <a defined email configuration>

    • sendTo : $(workflowContext.team_details.all_team_emails)

    • subject: Test Email

    • message: A test message.

After the getTeamDetails action runs, the workflowContext contains the base team details, enhanced with team member email addresses. It also includes a top-level field, all_team_emails, which provides a consolidated list of email addresses for all selected teams.

{
    "team_details": {
        "Cloud DevOps": {
            "room_id": 1,
            "alert_filter": "",
            "user_ids": [
                3
            ],
            "sig_filter": "",
            "landing_page": null,
            "description": null,
            "active": true,
            "team_id": 1,
            "services": [],
            "users": [
                "admin"
            ],
            "deleted": false,
            "name": "Cloud DevOps",
            "service_ids": [],
            "emails": [
                "someone@example.com"
            ]
        },
        "MyTeam": {
            "room_id": 2,
            "alert_filter": "",
            "user_ids": [
                5,
                8
            ],
            "sig_filter": "",
            "landing_page": "",
            "description": "",
            "active": true,
            "team_id": 2,
            "services": [],
            "users": [
                "spike",
                "test1"
            ],
            "deleted": false,
            "name": "MyTeam",
            "service_ids": [],
            "emails": [
                "test@test.com"
            ]
        },
        "all_team_emails": [
            "someone@example.com",
            "test@test.com"
        ]
    }
}