Build automation rules
How rules work in Laya WorkflowOS: triggers, conditions, actions, smart values, scope, testing, versions, templates, shared actions and moving rules between sites.
Last updated
On this page
A rule has four parts: WHEN (the trigger), IF (conditions, optional), THEN (actions, run in order) and SCOPE (the projects it applies to). You build them in Rules, with New rule, or start from Templates.
Triggers: when a rule runs
| Trigger | When it runs |
|---|---|
| Issue created | When a new issue is created. |
| Issue updated | When any field on an issue changes. |
| Issue transitioned | When an issue moves to a status. Pick the status in To status, or leave it as any status. |
| Comment added | When someone comments on an issue. |
| On a schedule | Periodically, against the issues a JQL search finds. Set Frequency (Every 5 minutes, Hourly, Daily or Weekly) and Find issues with this JQL. |
| Manual only | Only when you run it from the app. |
Rules that react to issue events usually run within a couple of minutes of the change. The app checks for due schedules every five minutes. To attach a rule to a workflow transition instead, see validators and post functions.
Conditions: whether a rule continues
Add conditions under IF with Add condition, and choose whether ALL or ANY of them must pass. There are five kinds:
| Kind | What it checks | Example |
|---|---|---|
| Field | A field against a value: equals, does not equal, contains, does not contain, is one of, is empty, is not empty. | Priority equals High |
| Field (dates) | For Due date, Created and Updated: is before now, is after now, is older than (days), is within the next (days), is within the last (days). | Due date is within the next 7 days |
| JQL match | Whether the issue matches a JQL query. | labels = urgent AND priority = High |
| Sub-tasks | Whether All are, Any is or None is in a status. | All sub-tasks are Done |
| Linked issues | The same, for linked issues, optionally by link type. | Any linked issue is Blocked |
| Expression | A Laya expression that must be true. | priority=="Highest" && daysSince(created) > 3 |
Field conditions can use Project, Issue type, Status, Priority, Summary, Labels, Assignee, Reporter, Resolution, Components, Fix versions, Affects versions, Due date, Created, Updated, Parent status and Parent key.
Actions: what a rule does
Under THEN, add actions with Add action. They run in order, and you can move them up and down.
| Action | What it does |
|---|---|
| Add a comment | Adds a comment. Smart values work in the text. |
| Add labels / Remove labels | Adds or removes one or more labels. |
| Set priority | Changes the issue's priority. |
| Change assignee | Assigns or unassigns the issue. |
| Transition issue | Moves the issue to another status. |
| Create a sub-task | Creates a sub-task under the issue. |
| Set resolution | Sets the resolution. |
| Set due date | Sets a fixed date, or one relative to today with a smart value such as {{now+7d}}. |
| Edit summary / Edit description | Replaces the summary or the description. |
| Set any field | Sets a standard or custom field by its field id. |
| Copy field A → B | Copies one field into another field of the same type. |
| Link to another issue | Creates an issue link of the type you choose. |
| Create an issue | Creates a separate issue in a project you choose. |
| Clone this issue | Copies the issue, and can link the clone to the original. |
| Send email (Jira) | Sends an email through Jira's own notifications. |
| If / Else branch | Runs different actions depending on a condition. |
| Run a shared sequence | Runs a reusable list of actions (see shared actions). |
| Export search results | Creates an export from a JQL query. |
| Generate a report | Creates a report from a JQL query. |
Each action has two safety settings: On error: continue or On error: stop decides what happens to the rest of the rule if the action fails, and No retry, 1 retry, 2 retries, 3 retries or 5 retries retries it after a passing error, such as Jira being briefly busy.
Smart values
Smart values fill in text when a rule runs. Use them in comments, summaries, descriptions, emails and field values.
| Smart value | Gives you |
|---|---|
{{issue.key}} | The issue key |
{{issue.summary}} | The summary |
{{issue.status}} | The status |
{{issue.priority}} | The priority |
{{issue.assignee}} | The assignee's display name |
{{issue.reporter}} | The reporter's display name |
{{issue.project}} | The project key |
{{issue.type}} | The issue type |
{{today}} | Today's date |
{{now}} | The date and time now |
{{now+7d}} / {{now-7d}} | The date a number of days from now, or ago |
{{field.customfield_10010}} | Any field, by its field id |
{{= expression }} | A calculated value from a Laya expression |
Scope
Under SCOPE, Limit to projects (optional) keeps a rule to the projects you pick. Leave it on All projects to apply it everywhere.
Save, test and publish
- Save & activate saves the rule and lets it run. Save as draft keeps it from running; publish it later from the rule list with Publish.
- The play button (Test) opens Test rule on an issue: enter an issue key, then choose Dry run to see what would happen with no changes, or Run for real to apply it.
- For a scheduled rule, Run scheduled rule now shows its JQL. Dry run lists the issues that match; Run now runs the actions on them, up to 25 issues.
- The rule list filters by status (Active, Draft, Disabled), trigger and tag. Select several rules to Disable them together.
- If an admin has turned on rule approval, a new or edited rule shows Pending and does not run until an admin approves it.
Version history, duplicate and delete
Each rule row has Explain with AI, Edit, Version history, Duplicate and Delete. Version history lists earlier versions of the rule, and Restore brings one back.
Templates
Templates is a library of ready-made rules, grouped into categories such as Triage, Assignment, Notifications and SLA & escalation. Search it, or ask AI to find the right one. A template opens in the rule builder, filled in, for you to adjust and save.
Shared actions
A shared sequence is a list of actions you build once in Shared actions and run from any rule with Run a shared sequence, for example a triage protocol or a release checklist. Only the person who created a sequence, or a Jira admin, can change it; others see it as read-only.
Back up and move rules between sites
In Settings, Backup & migration has Export (all your rules, as a JSON file) and Import rules. Imported rules arrive as drafts, so nothing runs until you publish it. Use it for backups, or to move rules from a test site to production.
Example rules
| Goal | Trigger | Conditions | Actions |
|---|---|---|---|
| Triage new high-priority bugs | Issue created | Issue type equals Bug, and Priority equals High | Add labels "needs-triage", Change assignee to your QA lead, Add a comment |
| Close a parent when its sub-tasks are done | Issue transitioned to Done | Sub-tasks: All are Done (on the parent) | Transition issue to Done, Add a comment |
| Weekly reminder on stale work | On a schedule, Weekly, JQL project = ABC AND statusCategory != Done AND updated <= -14d | None | Add a comment asking for an update, Add labels "stale" |
Email support@laya.net and include what you expected, what happened, and a link to the affected board or item so we can help quickly.