Skip to content

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.

The Rules page.

Triggers: when a rule runs

TriggerWhen it runs
Issue createdWhen a new issue is created.
Issue updatedWhen any field on an issue changes.
Issue transitionedWhen an issue moves to a status. Pick the status in To status, or leave it as any status.
Comment addedWhen someone comments on an issue.
On a schedulePeriodically, against the issues a JQL search finds. Set Frequency (Every 5 minutes, Hourly, Daily or Weekly) and Find issues with this JQL.
Manual onlyOnly 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:

KindWhat it checksExample
FieldA 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 matchWhether the issue matches a JQL query.labels = urgent AND priority = High
Sub-tasksWhether All are, Any is or None is in a status.All sub-tasks are Done
Linked issuesThe same, for linked issues, optionally by link type.Any linked issue is Blocked
ExpressionA 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.

ActionWhat it does
Add a commentAdds a comment. Smart values work in the text.
Add labels / Remove labelsAdds or removes one or more labels.
Set priorityChanges the issue's priority.
Change assigneeAssigns or unassigns the issue.
Transition issueMoves the issue to another status.
Create a sub-taskCreates a sub-task under the issue.
Set resolutionSets the resolution.
Set due dateSets a fixed date, or one relative to today with a smart value such as {{now+7d}}.
Edit summary / Edit descriptionReplaces the summary or the description.
Set any fieldSets a standard or custom field by its field id.
Copy field A → BCopies one field into another field of the same type.
Link to another issueCreates an issue link of the type you choose.
Create an issueCreates a separate issue in a project you choose.
Clone this issueCopies the issue, and can link the clone to the original.
Send email (Jira)Sends an email through Jira's own notifications.
If / Else branchRuns different actions depending on a condition.
Run a shared sequenceRuns a reusable list of actions (see shared actions).
Export search resultsCreates an export from a JQL query.
Generate a reportCreates 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 valueGives 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.
Building a rule, and a dry run of a scheduled rule (image from the Marketplace listing).

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

GoalTriggerConditionsActions
Triage new high-priority bugsIssue createdIssue type equals Bug, and Priority equals HighAdd labels "needs-triage", Change assignee to your QA lead, Add a comment
Close a parent when its sub-tasks are doneIssue transitioned to DoneSub-tasks: All are Done (on the parent)Transition issue to Done, Add a comment
Weekly reminder on stale workOn a schedule, Weekly, JQL project = ABC AND statusCategory != Done AND updated <= -14dNoneAdd a comment asking for an update, Add labels "stale"
Still stuck?

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.

Contact support