List tickets updated since the beginning of the last workday?

Mikhail T November 8, 2016

We have a daily "stand-up" meeting every morning, during which we report, what we've done since the previous such meeting -- during the previous workday.

How do I list my tickets updated during the period? For now I'm using:

 assignee = currentUser() AND updatedDate > -1d

but that does not do what I need on Mondays... I know, there is a startofweek() function, but comparing it with today() is not working – neither function can be on the left side of the comparision, apparently. Please, advise.

(Would've been nice to have the filter properly recognize holidays in addition to weekends, but such calendar-maintenance would, probably, be too much to ask.)

Thanks!

3 answers

0 votes
Marc Moroz February 18, 2019

Late to the show on this but I have your answer

((updated >= startOfDay(-3d) AND updated <= endOfDay(-3d) AND updated <= endOfWeek(-1w)) OR updated >= startOfDay(-1d))

 

The first part

(updated >= startOfDay(-3d) AND updated <= endOfDay(-3d) AND updated <= endOfWeek(-1w))

Finds anything that was opened 3 days ago and end of the week, which on a Monday will only show results from Friday

The second part

OR updated >= startOfDay(-1d)

Finds anything that was updated yesterday, which if not a Monday, will make sure you get stuff from any other day.

 

This works because on a Tuesday-Friday, the first part of the search which is looking 3 days back won't return anything because 3 days back won't be the end of the week.

Dmitry M. May 22, 2019

Hi Marc, the problem with this approach is that on Tuesday it will show tickets updated on Saturday and Sunday.

Paul Nalos March 1, 2021

Ok, I'll bite. Extending the above you get:

Pseudocode:

updated last week Friday and updated after the start of 3 days ago
OR
updated last week Saturday and updated start the start of 2 days ago
OR
updated since the start of 1 day ago

JQL:

(updated > startofweek(-2d) and updated < startofweek(-1d) and updated > startofday(-3)) or
(updated > startofweek(-1d) and updated < startofweek() and updated > startofday(-2)) or
updated > startofDay(-1)

 I wrote this today on a Monday, so totally possible I'll look silly tomorrow!

Paul Nalos March 15, 2021

Going further (and perhaps slightly off topic), if you want to do the same thing but for status changes, it's slightly harder:

status changed during (startofweek(-2d), startofweek(-1d)) AND NOT status changed after startofweek(-1d) AND status changed after startofday(-3)

OR status changed during (startofweek(-1d), startofweek(0d)) AND NOT status changed after startofweek(0d) AND status changed after startofday(-2)

OR status changed after startofDay(-1)

... or in English:

Status changed on the most recent Friday (and not after) and status changed after the start of three days ago... or status changed on the most recent Saturday (and not after) and status changed after the start of two days ago... or status changed since the start of yesterday.

0 votes
JamieA
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 9, 2016

This is very similar to https://answers.atlassian.com/questions/38755130 - you could see my gist there.

The code is much simpler though - if it's a Monday, just subtract 3 days instead of one.

Business holidays are a whole different world of pain - depends on your region etc.

Mikhail T November 10, 2016

if it's a Monday, just subtract 3 days instead of one.

That's the question, is not it? How would the query figure out, whether it is Monday or not?

JamieA
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 10, 2016

Whether the current day is a Monday? That seems like a solved problem, unless I'm missing something. Eg http://stackoverflow.com/questions/5270272/how-to-determine-day-of-week-by-passing-specific-date

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.
November 8, 2016

Hi Mikhail,

I suggest saving the following JQLs as filters with descriptive names that help you identifying each of them:

  • Get all issues where I am (or have been) the assignee and that have been updated yesterday or today:

    (assignee = currentUser() OR assignee changed FROM currentUser() AFTER startOfDay(-1)) AND updated &gt;= startOfDay(-1)
  • Get all issues where I am (or have been) the assignee and that have been updated during last Friday or after:

    (assignee = currentUser() OR assignee changed FROM currentUser() AFTER startOfWeek(-3d)) AND updated &gt;= startOfWeek(-3d)
  • Get all issues where I am the assignee and that have been updated after my specified date and hour:

    (assignee = currentUser() OR assignee changed FROM currentUser() AFTER "2016/10/31 08:00") AND updated &gt;= "2016/10/31 08:00"

Hope it helps.

 

Mikhail T November 9, 2016

Thank you, the idea to catch assignee-changes is an important one. But, it seems, you don't know any function that would refer to the last work-day either – you'd just use a separate filter on Mondays, right?

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.
November 9, 2016

I'm afraid that such a function does not exist. You have a complete list of supported functions here: https://confluence.atlassian.com/jirasoftwarecloud/advanced-searching-functions-reference-764478342.html

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.
November 9, 2016

It might be a good idea for you to subscribe to the first and second filters properly scheduled, and with the columns (fields) you would like to get. That way, every working day you will have an email with the list of issues you need.

Note that you can also set your subscription to be sent according to a cron expression, so you may potentially create a complex period and, maybe, you can set exceptions (holidays).

Suggest an answer

Log in or Sign up to answer