Skip to main content

Conditions and actions

This page lists what a rule can check and what it can change, and when rules run on a form.

Applies to: Script Master for Jira Β· Cloud

Kinds of rules​

Select + Add rule in the editor and pick one of two kinds:

KindUse it for
When a field has a valueChanges that depend on another field, such as requiring Due date when Priority is Highest.
When the form opensChanges that always apply, such as hiding a field or adding a hint.

Each rule has an options menu with Duplicate rule, Move up, Move down and Delete rule. On a When the form opens rule, Only when a field has a value adds a condition.

Conditions​

A conditional rule starts with WHEN: a field, a comparison and, for some comparisons, values. Select + and to add another condition. The rule applies only when all of its conditions match.

ComparisonMatches when the field
is any ofHas at least one of the values.
is none ofHas none of the values.
is emptyHas no value.
is not emptyHas any value.

For fields with a list of options, pick the values. For other fields, type a value and press Enter. An option matches by its name or its ID, so Highest works without looking up the option ID. A user matches by account ID.

Actions​

Under THEN, pick a field and what happens to it. Select + Add action to change more fields in the same rule.

ActionWhat it does
ShowShows the field.
HideHides the field.
Show and requireShows the field and makes it required.
RequireMakes the field required.
Make optionalMakes the field optional.
Make read-onlyLocks the field so people can't change it.
Make editableUnlocks a read-only field.
Set valueFills the field with a value. Dates use the YYYY-MM-DD format.
Add a hintSets the field's description. On the Create dialog, Jira shows it behind View details.
RenameChanges the field's label on the form.
Show only optionsOffers only the options you pick in a select field.
Hide optionsRemoves the options you pick from a select field.

The field picker groups fields by how well Jira supports them:

GroupWhat it holds
FieldsFields Jira supports for UI modifications.
Other fields: may not work on every formFields Jira doesn't list for UI modifications. Check them in Try it and on the real form.
Fields from Forge apps: Jira doesn't let apps change theseShown in action pickers only, and you can't pick them.

Undo changes when the condition stops matching​

A conditional rule has the option Undo these changes when the condition stops matching. It's on for new rules.

With it on, the fields go back to how they were when the form opened. For example, Due date disappears again when someone changes Priority from Highest to Low. If another rule still matches, that rule decides instead.

Set value isn't undone, because the person may have edited the value since. When a rule mixes Set value with other actions, the option reads Undo these changes when the condition stops matching (set values stay). A rule with only Set value actions has no undo option.

When rules run​

  • When the form opens, every rule runs.
  • After someone changes a field, only the rules whose conditions read that field run again. This keeps a rule from overwriting what someone typed a moment ago.
  • So a When the form opens rule runs once, when the form opens.
  • When two rules change the same property of the same field, the later rule wins. Use Move up and Move down to change the order.
  • After the rules of every UI modification, each script runs. A script can change what a rule set.