Skip to main content

Build a rule without code

Build a validator or condition from checks, such as "Assignee is set" or "The person doing it is the reporter". Script Master turns the checks into the Jira expression that Jira runs, so you don't write code.

Applies to: Script Master for Jira Β· Cloud, company-managed and team-managed spaces

Before you begin​

  • Jira permission: for a company-managed workflow, the Administer Jira global permission. For a team-managed space, a space admin can build the rule.
  • The rule's editor is open in Jira's workflow editor. See Add a validator or Add a condition.
  • A new rule opens with Build with rules selected. For a rule saved as an expression, select Build with rules, then Start over. The checks start empty and replace the expression.

Build the rule​

  1. Under Start from a template, select a template, or select Add a check.

  2. In the check, choose what to check, for example Assignee, The person doing it or Subtasks.

  3. Choose the comparison, for example is set or is one of.

  4. Enter or pick the value, if the comparison needs one.

  5. Next to Allow the transition when (validator) or Show the transition when (condition), choose all or any of the checks.

  6. Optional: under Only check when, select Add a condition, for example work type or space to limit the rule to some work items.

  7. For a validator, write the Message when it blocks.

    The rule builder with two checks, an Only check when condition and a message

Result: Under the checks, Valid expression confirms that Jira accepts the rule. Test it before you save. See Test a rule on a work item.

Templates​

TemplateRule kindWhat it sets up
A field must be setValidatorAssignee is set, with a message
Not the reporterValidatorThe person doing it isn't the reporter, with a message
Due date in the futureValidatorDue date is after today, with a message
Only some groupsConditionThe person doing it is in groups you pick
Only some space rolesConditionThe person doing it has space roles you pick
Only the assigneeConditionThe person doing it is the assignee
All subtasks doneBothEvery subtask is in a done status
Only some work typesBothAdds Work type under Only check when, and keeps your checks

Every template except Only some work types replaces your checks. That one adds a Work type condition and keeps the checks you have.

What you can check​

What to checkComparisons
Text fields, such as Summary or Descriptionis set, is empty, contains, doesn't contain, has at least … characters
Number fieldsis set, is empty, =, β‰ , <, ≀, >, β‰₯
Date fields, such as Due dateis set, is empty, is before today, is after today, is within the next … days
Work type, Status, Priority, Resolution, select listsis set, is empty, is one of, is not one of
Labels, Components, versions, multiple choice fieldshas a value, is empty, has any of, has all of, has none of
A person field, such as Assigneeis set, is empty, is the person doing it, is not the person doing it, is one of
A people fieldhas a value, is empty, includes the person doing it, doesn't include the person doing it
Spaceis one of, is not one of
The person doing itis in any of these groups, is in none of these groups, has any of these space roles, is the assignee, is not the assignee, is the reporter, is not the reporter
Subtasksare all done, exist, don't exist
Other fieldsis set, is empty

Only check when offers fields only, not The person doing it or Subtasks. Work items that don't match it pass a validator, and always see a condition's transition.

Message when it blocks​

A validator shows its message when it blocks a transition. A condition has no message, because Jira only hides the transition.

  • Select Insert value to add a placeholder, such as [Work item key]. Jira fills in the value for the work item. You can use Work item key, Summary, Work type, Status, Space, Person's name, and every field your checks use.
  • Leave the message empty, and Jira shows its default message.
  • Turn on A different message per check to give each check its own message. Jira shows the message of the first check that fails. It works only with all.
  • A message can be up to 300 characters and can't contain a backslash.

See or edit the expression​

Select Show the Jira expression this builds to see the code. To change it by hand, select Edit as expression.

After you change the expression, the rules no longer match it, and Jira runs your expression. To return to the rules, select Go back to the rules (drops your changes).

Limits​

  • Up to 10 checks, and up to 10 conditions under Only check when.
  • The expression the rules build can be up to 10,000 characters, Jira's limit for one expression. With many values or long messages, the builder says the rule is too long.