Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Using the OR function

Toby Moore
Contributor
August 10, 2018

Hi guys, so we use jira queries in confluence for reporting purposes and it works really well. Im just trying to optimise how we create the reports as currently there are a lot of dates to edit weekly and if ones forgotten then the numbers are out of sync.

The current query is

project = A1 status changed TO ("In Implementation") DURING ("2018-07-29", "2018-08-04") AND "epic link" = EMPTY and assignee not in (joe.bloggs) OR status changed TO ("In UAT") DURING ("2018-07-29", "2018-08-04") AND "epic link" = EMPTY and assignee not in (joe.bloggs)        

so I've had to duplicate the query after the OR function, what im trying to do is something like

project = A1 AND (status changed TO ("In Implementation") OR status changed TO ("In UAT")) DURING ("2018-07-29", "2018-08-04") AND "epic link" = EMPTY and assignee not in (joe.blogs)

So here ive not duplicated the full query just the things that differ meaning there is only one date per query. the above doesnt work but I wanted to know if anybody knew of anything similar to allow this to be done? 

2 answers

1 accepted

1 vote
Answer accepted
Chris Nicosia
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.
August 10, 2018

Hi Toby - you should be able to do this by just putting both of your status values in the same list for Status Changed To.  See below where I have adjusted your second query to make it work.  As long as you are using the same During dates for those statuses, this will work fine. 

project = A1 AND status changed TO ("In Implementation","In UAT") DURING ("2018-07-29", "2018-08-04") AND "epic link" = EMPTY and assignee not in (joe.blogs)

 

Check out this article for more helpful tips and tricks: https://moduscreate.com/blog/searching-need-jira-using-jql/

Toby Moore
Contributor
August 13, 2018

Thanks, I swear when I first tried this I had to switch to using an 'OR' statement because it was looking for tickets that entered both of those states during that time frame rather than just one or the other. that does seem to work though, thanks.

0 votes
Ignacio Pulgar
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.
August 12, 2018

Chris answer is correct.

Besides, you may wish to remove the need for updating the filter by using relative dates within the During clause:

...DURING(startOfWeek(), endOfWeek())...

That would refer to the current week, but could be changed to last week like this:

...DURING(startOfWeek(-1), endOfWeek(-1))...

Toby Moore
Contributor
August 13, 2018

Thanks Ignacio, I did look at this when we first created the query but I believe they are all relevant to the current date? The idea here is that these reports are a static snapshot of that point in time which is why we use dates 

Ignacio Pulgar
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.
August 13, 2018

For taking a snapshot, the problem is that the query can potentially return different sets of issues over time, ie: once an issue is added to an epic, it won't be retrieved by the filter.

In order to avoid these changes, you may load the page at the date and time at which you wish to take the snapshot. Then, select all elements in the page with Ctrl + A and copy it with Ctrl + C (both in view page mode), and paste it with Ctrl + V to a new page (edit mode).

Because of the previous technique, it is usually better to work with relative dates, as it avoids the need for having to edit the filter's query.

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events