Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 21:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

JQL Learner

Michael Gold
Contributor
November 29, 2022

Please help me with this:

category = DEV and Assignee = currentUser() OR status changed AND project = CERT AND issueTypein standardissueTypes() AND due< endOfWeek(-1)

 

This is an example within my exam prep. 

2 answers

1 accepted

1 vote
Answer accepted
Sam Nadarajan
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 29, 2022

Hello @Michael Gold , we aren't sure what you are specifically asking for here. If you want to know how to read this query let's break it down:

  1. category = DEV - You can categorize projects by setting the project category field at the project level. In this case, look for all Jira projects categorized as "Dev"
  2. Assignee = currentUser() - Query issues that are assigned to the currently logged in user
  3. status changed - checks to see if the status changed
  4. project = CERT - look for the CERT project only
  5. issueType in standardissueTypes() - excludes subtasks, only includes standard issue types such as epics, stories, bugs, tasks, and any custom standard issue types you've created
  6. due< endOfWeek(-1) - checks if this was due before the end of last week

The "OR" is definitely something to be careful of, especially if you do not see parentheses. Without parentheses, you could easily get different results than what you were expecting. 

Michael Gold
Contributor
November 29, 2022

But what does the "OR" represent in the query?  What does it speak to in the example I placed in the discussion?

0 votes
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 29, 2022

Humans are very bad at logic, and we tend not to understand how our language around logic is poor and hence when we ask a computer to answer a logic question, we often fail to understand what we're actually saying to them.

My bet is that your query is working fine, but because you have used both and and or to join clauses, you don't actually understood what you have asked of the computer.  (If you were using all "and", then you're asking "show me issues that match all the criteria", if it were all "or", the question would be "show me issues that match any of the criteria")

The computers simply read left to right when they get a query, so I'm 99% certain that you're not meaning to use the or in the middle as it has been.  In fact, because it's so hard to grasp what you've actually said to the computer, I've never learned to read them, I always write clarified JQL.

You clarify with parentheses.  I can't tell what your query is actually supposed to be asking, but one of the easy to explain ones would be

( category = DEV and Assignee = currentUser() ) OR ( status changed AND project = CERT AND issueTypein standardissueTypes() AND due< endOfWeek(-1) )

This would be : list all the issues that are either

  • In Dev and assigned to the current user
  • have had status changed, are in project cert, and are base issues (not sub-tasks), and are due before the end of last week

The parenthesis make how the clauses join up crystal clear to humans and the computers.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events