---
title: "JQL validator"
canonical: "https://support.appfire.com/space/JSU/2236285674/JQL%20validator"
format: markdown
---
> Macro (aura-html)

## Description

The JQL validator compares the number of issues returned from the JQL query against predefined conditions such as:

- Must find at least one issue
- Must not find any issue
- Compare with a particular number

## Configuration

Write your required JQL expression and choose one option for the number of issues found. For example, *Number of issues must > 2*.

> ℹ️ #### JQL-based validators and conditions on the Create transition
> ℹ️ 
> ℹ️ When a validator or condition that uses JQL is configured on the **Create transition** (initial state transition), the work item has not yet been created in Jira. As a result, the item key does not exist at validation time.
> ℹ️ 
> ℹ️ Because of this, JQL expressions that rely on `{issue.key}` (for example, `key = {issue.key}`) cannot be evaluated and may block item creation.
> ℹ️ 
> ℹ️ To use `{issue.key}` in a JQL expression, configure the validator or condition on a transition that occurs after the work item has been created.

## Examples

##### **Is the Issue in the current sprint?**

```
Sprint in openSprints() AND key = {issue.key}
```

##### **In the IT department, only the approver can perform the transition**

```
approver = currentUser() OR component != "IT department"
```

The validator passes if the current user is in the Approver field `OR` anything not belonging to the IT department. 

##### **All other siblings must have status**

```
parent = {issue.parent} AND key != {issue.key} AND status in (Resolved, Closed)
```

With `parent = {issue.parent}` we find all siblings of the current subtask. However, we want to exclude the current subtasks, so we add `key != {issue.key}`.

### Optional error message

You can define a [custom error message](https://appfire.atlassian.net/wiki/spaces/JSU/pages/12682303) for JSU validators to provide a clear explanation of the situation to your users. If you leave this field empty, a default error message is displayed for validation errors. 

## See also

- [JQL Reference](https://appfire.atlassian.net/l/cp/Bq7bwnwp)
- [ Supported Field Types](https://appfire.atlassian.net/l/cp/wMNWeU83)