Triggers let you create actions in your app. Here are some common uses of a trigger:

  • Send a Slack alert to the management team if the severity level is critical.
  • Invite different people to an activity based on a select dropdown.
  • Use a different attribute than conclusion to close an activity.
  • Send email to people outside the organization (email support is currently in beta).

Notice about triggers
Triggers are not yet supported in the app builder and require that you use the code editor.

A trigger is associated with an attribute or an option in a select dropdown menu, and fires when the attribute changes or the dropdown option is selected.

Here is an example that sets a different owner and member list based on the choice of location:

{
  "name": "location",
  "type": "select",
  "label": "Office location",
  "options": [
    {
      "name": "uk",
      "label": ":flag-gb: London",
      "trigger": {
        "owner": "@tina",
        "members": "@emea-sre-team",
        "alert": "#incidents-uk"
      }     
    },
    {
      "name": "us",
      "label": ":flag-us: Washington DC",
      "trigger": {
        "owner": "@dave",
        "members": "@us-sre-team",
        "alert": "#incidents-us"
      }     
    }
  ]
}

These members and alert settings will be appended to the blueprint’s member and alert settings (not replace them).

The above example also sends alerts to different channels, based on the user choice.

{
  "name": "input",
  "type": "text",
  "label": "Update this field to send a message",
  "trigger": {
    "message": {
      "to": "#log, @myname",
      "body": "Update from my app:\n${input}"
    }
  }     
}

When someone changes the text the trigger will send a message to a channel and a user. Here we use macro substitution to insert the text in the input attribute into the message.

Trigger definition

A trigger can either be associated with an attribute or an option in a select menu. It is activated when the attribute changes, or when the select menu is chosen.

These are the possible actions a trigger can perform:

  • owner: Change the owner of the activity.
  • members: Add people to the member list.
  • alert: Add people to the alert list.
  • message: Send a Slack message to anyone on the team.
  • set_attribute: Set an attribute value.
  • conclude: Conclude the activity.

In fact, the trigger can perform all of these activities when the trigger fires.

The examples above illustrate the three first actions, so let’s take a look at setting an attribute value and concluding the activity.

Here is a trigger that both sets an attribute value and closes the activity:

{
  "name": "decision",
  "type": "select",
  "label": "Decision",
  "visible": "edit,conclude",
  "options": [
    {
      "name": "yes",
      "label": ":thumbsup: Yes"
    },
    {
      "name": "no",
      "label": ":thumbsdown: No"
    }
  ],
  "trigger": {
    "conclude": true,
    "set_attribute": {
      "name": "conclusion",
      "value": "The decision was ${decision.label}"
    }
  }
}

Notice how the set_attribute action uses a name and a value to specify which attribute to set, and the new value.

This is a useful pattern if you want to use another attribute to conclude an activity, such as a select menu instead of the standard conclusion text.

If you also set the protected property, your app will restrict who can make a decision.

Cascading set-attribute triggers will not work:
What if you have a chain of set-attribute triggers in a loop, so that a => b => c => a. Would an infinite loop of triggers cause the melt-down of a Google datacenter? Cascading triggers may lead to bad outcomes, which is why Conclude detects and stops them.

Supercharge your team!

Bridge the collaboration gap with Conclude apps.

Quickstart