Configuring Insight automation rules
You can create automation rules that automatically perform actions (for example, notify users) based on specific events (for example, object updated) for all objects, or only a group of objects in a schema.
Before you begin
Make sure you have the right permissions:
- To configure automation rules, you need to have at least the Insight manager role for the schema.
- Tu run and execute automation rules, the user (either the logged-in user or the user that you select for running scheduled events) needs to have at least the Insight users role for the schema. If this user has a different role for the object types affected by the rule (object type's permissions take precedence over schema's permissions), then also grant them the Insight users role for these object types. This is only needed if a rule affects such object types, otherwise permissions are inherited from the schema.
For more info about permissions, see Configuring roles and permissions.
Create a rule
- Open your schema, and select Object schema > Configure.
- Switch to the Automation tab.
- Create a rule.
- Enter the rule's name and description.
- Select each of the boxes (WHEN, IF, THEN). A panel will appear on the right allowing you to add an event, condition, and action. You can read more about them below.
Any changes to your rule will only be saved after you select Save. If you've deleted something by mistake, you can select Cancel to revert these changes.
Configure your rule
Configure your rule by specifying events (WHEN), conditions (IF), and actions (THEN).
1. Add events (WHEN)
- Select the WHEN box.
- On the right, select Add events.
- Select the desired event, then select Add.
Good to know
- You can add up to five events for a single rule.
- Instead of creating two or more rules with the same actions (for example, email notification), add two or more events to the same rule. It will be easier to maintain later.
Event types
Event type | Description |
---|---|
User events | Most events, except the Scheduled event are triggered when a logged-in user performs an action on an object (object updated, attachment added, etc.) These events don't require any additional configuration. |
Scheduled events | Scheduled events aren't triggered by an action performed by a user. They run according to the specified cron expression (e.g. once a day, once an hour) and conditions. |
2. Add conditions (IF)
You can add a condition if you don't want the configured action to apply to all objects in your schema, but rather a specific set of objects.
- Select the IF box.
- On the right, select Add condition.
- Enter an IQL statement and select Add.
Good to know
- A condition (IF) always needs a THEN box. When you add another condition, you'll be able to edit its actions.
- You can configure up to three IF/THEN pairs.
Example
- A rule is triggered by an object updated event.
- The rule has a condition: "name = Windows server".
- The rule has an email notification action.
The rule configuration in this example means that if a user updates an object whose exact name is “Windows server”, an email notification is automatically sent.
3. Add actions (THEN)
- Select the THEN box.
- On the right, select Add action.
- Select your action and fill in the details. Every action requires different information. For example, details needed for Create a Jira issue will differ from those needed to Execute a Groovy script.
- Select Add.
Good to know
- You can have up to five actions for every THEN box.
Available actions
Here's a list of actions that you can select:
4. Add more conditions and actions
A rule can only consist of one event (WHEN), but it can have up to three pairs of conditions and actions (IF/THEN). This allows you to add more conditions and actions, if the first ones aren't matched.
- Select the ELSE IF / THEN box.
- Add actions, and conditions if needed.
- Select Save.
More automation
Automation rules are related to a specific object scheme, but there's way more automation that you can add. Your Jira admin can add conditions and validators, as well as post-functions, to Jira workflows that will make issues affect objects while they're being transitioned through workflows. For more info, see Adding Insight functions to Jira workflows.