In this video, you'll learn how to write a simple JQL query.
To write a query using JQL, you’ll need three things.
The field, which Jira uses to store data.
The operator, which compares the field to the value.
And a value, which is the information we’re looking for in that field.
Together, these make a clause.
You can have multiple clauses in a query.
You can then connect clauses using keywords.
Let’s try this out.
Say you wanted to see all the bug issues your teammate Patrick Selman reported within a
project called 'Lima'.
In the query, we’ll need three clauses.
One for the 'reporter’, Patrick.
Another to define which project we’re looking in.
And a third for the issue type "Bug".
Let's try to write this query in Jira.
Select 'Search' from the navigation bar, then select 'Advanced issue search'.
Type 'reporter' in the JQL text box to select the field, then hit the spacebar once to add
the operator 'equals' and once to add the value you’re looking for
in that field, which is the user "Patrick".
Next, add a keyword to join this clause to the next by hitting the spacebar again.
In this case, use the keyword 'AND' because we’re looking in more than one field.
Hit the spacebar to define your next field 'project'.
Then add the operator 'equals'.
Add the value for the field, "Lima".
Add the last clause by hitting the spacebar to add the keyword 'AND', the field 'issuetype',
the operator 'equals', and the value for the issue type, "Bug".
Select 'Search'.
Now, we’ve filtered the specific issues we wanted, we've found the issue we were looking
for.
Let’s try another example.
Say you want to track down all unassigned issues in the Lima project.
We’ll need to define the project and the assignee value we’re looking for.
Select 'Search' from the navigation bar, then select 'Advanced issue search'.
Type your first field, ‘project’.
Use the spacebar to add the operator 'equals' and the value "Lima".
This isolates the project.
Use the spacebar to find the keyword 'AND' for another clause.
Add 'assignee' as your field, then add the statement 'is EMPTY'.
Select 'Search'.
This means that Jira will now show issues where the assignee field is blank.
You can see the query will now return issues in the Lima project that don’t have an assignee.
JQL may look complicated.
But, once you understand how the different elements work together, you can use it to
run fast and powerful queries that sort through hundreds or thousands of issues at once.