JQL Query Matches Condition

Use the JQL Query Matches Condition to control if an issue can be transitioned based on if a JQL query would return the current issue.

For example:

  • If you want the transition to be allowed when the current issue is using the Task issue type, you would use the JQL query: issuetype = "Task"
  • If you want the transition to be allowed when the current issue has a Priority of Medium or higher, you would use the JQL query: priority >= Medium

You can add this condition to any transition except the Create transition.

  1. Select the JQL Query Matches Condition [ScriptRunner] condition.

    For details on how to navigate to ScriptRunner workflow functions, see Navigating to Workflow Functions.

  2. Enter a description of the condition in Note.
  3. Enter your JQL Query.

  4. Click Update.

Testing your JQL

You can use the Preview feature within the workflow condition to test your JQL query against a specific issue.

  1. Edit or create a new JQL query matches condition.
  2. Enter your JQL Query.
  3. Enter the key for an issue you want to test with into Preview Issue Key.
  4. Click Preview.

This conditions JQL is reasonably efficient because even if the query you enter would return millions of issues, it will be modified to something like the below:

groovy
{issue = 15130} AND {issuetype = "Task"}
On this page