Configuring automation rules
You can create automation rules that automatically perform actions (e.g. notify users) based on specific events (e.g. 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 role 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 5 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 the 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'd usually configure a condition when 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 always comes in pair with a THEN box. When you add another condition, you'll be able to edit actions for it.
- You can configure up to 3 IF/THEN pairs.
Example
- A rule has an event "Object Updated".
- A rule has a condition "Name = Windows server".
- A rule has an action "Notification Email".
This rule will only send a notification email if the object that was changed by a user has the exact name "Windows server".
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 details, 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 5 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.