Whether you’re a project manager, a developer, or a tester, mastering JQL functions can put you ahead of 80% of the work within project development.
Jira is a robust tool, but with so much data, it’s easy to feel overwhelmed. Standard searches can only take you so far. That’s where JQL functions allow you to build dynamic, highly customized queries to quickly find the information you require.
From tracking all unresolved issues in a sprint to identifying tasks linked to a specific epic, JQL functions are the secret to making Jira work smarter, not harder.
However, many users don’t even realize the power of these functions or how to use them effectively. That’s why this guide is here to break it all down step by step.
We’ll show you the essential JQL functions, explain how they can transform your Jira experience, and introduce tools like PaceAI to make the process even smoother.
What Are JQL Functions?
JQL functions are predefined operations in-built Jira that allow you to retrieve, analyze, and organize issue data beyond basic search capabilities. Unlike static searches, JQL functions are dynamic, meaning they automatically adjust their results based on your customized input.
For example:
- The function currentUser() always shows issues assigned to the person running the query.
- The function epicsOf() dynamically retrieves all issues linked to a specific epic.
These functions enable advanced searching by allowing you to create highly specific queries tailored to your workflow.
Why Are JQL Functions Essential in Jira?
Functions add flexibility to queries because they replace values that would need to be regularly updated. For example, some of the most common JQL functions are:
- membersOf()
- linkedissue()
- opensprint()
Here’s why JQL functions are indispensable:
- Advanced Query Customization
Functions like subtasksOf() or linkedIssuesOf() allow you to search within specific relationships between issues, such as finding subtasks for a parent task or linked issues for a bug report.
- Real-Time Updates
Because JQL functions are dynamic, the results always reflect the most current state of your projects. For example, the openSprints() function will only show tasks from sprints that are currently active.
- Efficiency
With functions like membersOf() or filter(), you can instantly pull results relevant to a specific user group or apply pre-saved searches, cutting down on manual effort.
- Scalability
For large teams managing hundreds of projects, JQL functions make it easy to slice through the noise and get actionable data in seconds.
Essential JQL Functions You Need to Know
JQL functions are the backbone of advanced searching in Jira, allowing you to create queries that range from the basic to the highly sophisticated. JQL searches have a field, an operator, and a function.
The first two are relatively straightforward, but let’s focus on the third for a moment. A function defines a variable with a word, such as approver, and a set of parenthesis after the word.
This set of parenthesis can include a qualifier(s) inside to help further define the set of values the function uses, but they aren’t required.
Here’s a structured list of JQL functions, from the basic built-in options available in Jira to the more advanced and custom functionalities offered by ScriptRunner.
Basic Built-In JQL Functions
- currentUser()
This syntax returns all issues assigned to the current user. It is used as
Syntax:
assignee = currentUser()
Use Case: Perfect for viewing personal workloads.
- membersOf()
This syntax returns issues assigned to members of a specific group.
Syntax:
assignee IN membersOf(“jira-developers”)
- createdDate
This syntax filters issues by their creation date.
Syntax:
created >= “2024-01-01”
- labels
This syntax searches the issues tagged with specific labels.
Syntax:
labels = “critical”
Intermediate JQL Functions
- issueFunction IN dateCompare()
This syntax compares the two dates on an issue.
Syntax:
issueFunction IN dateCompare(“created > updated”)
Use Case: Identify issues that were updated after being created.
- epicsOf()
The purpose of this syntax is to return all issues linked to a specific epic.
Syntax:
issue IN epicsOf(“EPIC-123”)
- subtasksOf()
The purpose of this syntax is to retrieve subtasks of a specific issue.
Syntax:
issue IN subtasksOf(“TASK-456”)
- filter()
This syntax is to reuse a saved filter in a query.
Syntax:
filter = “My Open Issues”
Advanced ScriptRunner JQL Functions
Suppose you’re using JIRA with complex projects and multiple dependencies. In that case, you will need to use the ScriptRunner extension. Scriptrunner expands Jira’s built-in functions, enabling users to handle complex searches and automation.
Here are a few syntaxes that are common within the ScriptRunner JQL functions:
- issueFunction IN linkedIssuesOf()
This syntax retrieves all the issues that are linked to a specific issue within your project.
Syntax:
issueFunction IN linkedIssuesOf(“BUG-123”)
- issueFunction IN hasLinks()
This syntax can help you find issues that have specific types of links.
Syntax:
issueFunction IN hasLinks(“blocks”)
Use Case: This syntax is useful for tracking dependencies.
- issueFunction IN parentsOf()
This syntax is meant to find parent issues of specified subtasks.
Syntax:
issueFunction IN parentsOf(“subtaskQuery”)
- issueFunction IN dateCompare()
This syntax compare any two custom or system dates.
Syntax:
issueFunction IN dateCompare(“created > resolved”)
Use Case: This syntax is useful for tracking overdue or resolved issues.
- issueFunction IN aggregateExpression()
This syntax performs arithmetic calculations on numeric fields.
Syntax:
issueFunction IN aggregateExpression(“sum(originalEstimate) > 40h”)
Pro Tips for Effective JQL Searches
Whether you’re working on a small-scale project or managing multiple teams, these tips will help you create powerful, reusable, and time-saving JQL queries.
Combine Functions with Boolean Operators for Precision
Boolean operators (AND, OR, and NOT)help you create precise and powerful queries. By combining JQL functions with these operators, you can zero in on the data you need exactly.
Example 1: Filtering by Multiple Criteria
Find high-priority issues in progress that belong to a specific sprint:
priority = High AND status = “In Progress” AND sprint IN openSprints()
Example 2: Searching for Issues Outside a Category
Identify unresolved issues that are not assigned to the current user:
resolution = Unresolved AND assignee != currentUser()
Pro Tip: Use parentheses to group complex conditions, especially when combining OR and AND. For example:
(priority = High OR priority = Medium) AND status = “To Do”
Save Frequently Used Filters for Reusability
If you often run the same type of queries, save them as filters in Jira. Filters make your searches easily accessible and shareable with your team.
- How to Save a Filter:
- Run your JQL query in the search bar.
- Click the “Save as” button.
- Assign a name and description to the filter.
- Benefits of Filters:
- Time-Saving
- Team Collaboration
- Easy visualization with dashboards
Example Saved Filters:
“Open Bugs”:
project = “Product A” AND issueType = Bug AND statusCategory = “To Do”
Tasks Assigned to Me
assignee = currentUser() AND statusCategory != Done
Use Relative Dates for Dynamic Queries
When dealing with timelines, relative dates (like -7d for the past 7 days) make your queries future-proof and adaptable.
Example 1: Recently Updated Issues
updated >= -7d AND status = “In Progress”
Example 2: Recently Created Issues
created >= -30d AND priority = Critical
This syntax will retrieve critical issues created in the past 30 days.
Iterate and Test Your Queries
Don’t aim for perfection on your first try. Start small, test your queries, and iteratively add complexity. Use Jira’s preview feature to check the results as you refine your query.
Conclusion
By mastering these JQL functions and using tools like the JQL generator from PaceAI, you’ll not only enhance your Jira experience but also take your decision-making process into project management to the next level. Start exploring the JQL functions today.
FAQs
What is the purpose of JQL functions?
JQL functions enhance Jira’s search capabilities, enabling users to handle complex queries and retrieve data efficiently.
Can JQL functions work with custom fields?
Yes, JQL supports custom fields as long as they are correctly indexed.
How do I find all open issues in a project?
You can find open issues in a project by typing in the following syntax
project = “ProjectName” AND statusCategory = “In Progress”
Leave a Reply