Query Writing Recommendations
Follow our recommendations below for writing efficient JQL queries and check out our video walkthrough.
Filters inside functions, not outside
Context | Details |
|---|---|
| Common in: | issuesInEpics, linkedIssuesOf, childrenOf |
| Why this matters: | Enhanced Search always evaluates the function argument first, before applying any filters outside the function. When filters are placed outside the function, Enhanced Search must process a much larger set of issues than necessary. This increases execution time and can lead to search timeouts, especially due to Atlassian Cloud performance limits. |
| Best practice: | Always place project, status, and date filters inside the function itself, so only relevant issues are evaluated from the start. |
| What to do: |
|
| Example: | ❌ Inefficient (filters outside the function)In this example, Enhanced Search first retrieves all matching epics, then Jira applies the filters afterward. This forces Enhanced Search to process more data than necessary. ✅ Optimized (filters inside the function)Here, the filtering happens within the function, significantly reducing the data set processed. |
Use clear, scoped filters
Context | Details |
|---|---|
| Common in: | issuesInEpics, linkedIssuesOf, childrenOf |
| Why this matters: | When a function is given an empty or overly broad filter, Enhanced Search must evaluate all possible related issues before narrowing the results. This significantly increases processing time and can lead to search timeouts, particularly within Atlassian Cloud performance limits. |
| Best practice: | Always provide a clear, scoped JQL filter inside the function so Enhanced Search evaluates only the issues you actually need. |
| What to do: |
|
| Example: | ❌ Inefficient (unscoped function argument)In this example, the second argument is empty, causing Enhanced Search to search across all linked issues in project This results in unnecessary processing and slower performance. ✅ Optimized (scoped filter)Here, the query explicitly limits the relationship to issues that block others, significantly reducing the dataset evaluated. |
Always include a project filter
Context | Details |
|---|---|
| Common in: |
|
| Why this matters: | Project filtering is a strong way to prevent Enhanced Search from scanning your entire Jira instance, which can cause timeouts and slow queries. |
| Best practice: | Always include a project filter inside the function to limit the search scope. |
| What to do: |
|
| Example: | ❌ Inefficient (no project filter)The function only receives
✅ Optimized (with project filter)Adding the project filter limits the parent issues searched:
|
Add a time window
Context | Details |
|---|---|
| Common in: | linkedIssuesOf, issueFieldMatch, attachment/comment keywords |
| Why this matters: | Time-based filtering reduces the number of issues Enhanced Search must inspect. Without a time window, functions may evaluate every matching issue, increasing execution time and the risk of timeouts. |
| Best practice: | Add a time-based condition inside the function to limit results to relevant, recent issues. |
| What to do: |
|
| Example: | ❌ Inefficient (no time filter)The function processes all issues in the project, regardless of age:
✅ Optimized (with time filter)This limits the search to issues updated on or after December 1, 2025:
|
Narrow by issue type
Context | Details |
|---|---|
| Common in: | linkedIssuesOfRecursive, epicsOf, parentsOF |
| Why this matters: | Recursive and relationship-based functions expand through linked issues. If issue types are not restricted, Enhanced Search may follow links across every issue type in your Jira instance, dramatically increasing execution time and increasing the risk of timeouts. |
| Best practice: | Always include an issue type filter inside the function when using recursive or relationship-based functions. |
| What to do: |
|
| Example: | ❌ Inefficient (unrestricted issue types)In this example, the function follows all linked issues, then continues expanding through every connected issue type. This causes unnecessary expansion and increases processing time. ✅ Optimized (restricted issue types)Here, the search is limited to only Stories and Bugs, keeping the recursive expansion controlled. |