English

Workflow validator

Documentation

The validator Work item matches JQL checks a work item against a JQL query when someone makes a transition. It is a Forge Preview module and works in company-managed project workflows with the new workflow editor.

Add the rule

A Jira administrator opens Project settings, then Workflows, selects the transition, then Rules, Validators and Add rule, and chooses Work item matches JQL.

Settings

Setting Meaning
Allow only when it matches The transition is allowed only if the work item matches the JQL.
Block when it matches The transition is blocked if the work item matches the JQL.
JQL Any JQL, including Flexible JQL functions, up to 2,000 characters.
If the check cannot run Block (the default) or Allow, for a license lapse, a Jira outage or a timeout. The check has 5 seconds.
Message Optional text, up to 255 characters, shown when the transition is blocked.

For example, allow Done only when no subtask is open:

fjOpenSubtaskCount = 0

How it decides

When someone makes the transition, Flexible JQL runs your JQL limited to that one work item, as the app. The JQL is checked when you save the rule and again every time it runs. A rule that is set up wrongly, with empty or invalid JQL, always blocks, and the message says why and how an administrator can fix it. The rule is never silently skipped.

Good to know

  • currentUser() is not allowed, because the rule runs as the app. Use a group instead, for example assignee in membersOf("team").
  • The JQL sees the work item as stored in Jira, not values typed on the transition screen.
  • Functions can be nested two levels deep, and ORDER BY is not allowed.
  • The Create transition cannot be checked, because the work item has no key yet, and is always allowed.
  • A workflow condition that hides the transition button is not available, because Forge conditions cannot run JQL.