Conflict in query related to search of issues with empty time logs

Vlad Olekhnovich June 21, 2021

Hey there!

I have following query, which should return issues, what has no time logged by current user for previous month:

assignee in (currentUser()) AND (worklogAuthor != currentUser() or timespent is EMPTY) AND project not in ("project1", "project2", "project3") and created >= startOfMonth(-1) AND created <= endOfMonth(-1)

Currently, it returns issues that has time logged by a current user.

I tried to consolidate condition worklogAuthor != currentUser() or timespent is EMPTY via AND operator, but in this case I got nothing.

Seems like, it returns issues that that has logged time, because issues has time logged not only by current user. I made this conclusion, since all four issues, what query returns to me, has time logged by me as current user and another user:

 Untitled.png

1 answer

1 accepted

1 vote
Answer accepted
Bill Sheboy
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.
June 21, 2021

Hi @Vlad Olekhnovich  -- Welcome to the Atlassian Community!

Please try to substitute that clause with this:

(worklogAuthor != currentUser() AND timespent IS NOT EMPTY) OR (timespent IS EMPTY) )

This will separate the two things you are checking for:

  • Time was spent by someone other than the current user, or
  • No time was spent


Best regards,

Bill

Vlad Olekhnovich June 22, 2021

Thanks for warm welcoming and your answer, Bill!

Your proposal is reasonable, but main idea of the filter is to receive issues that was assigned to a current user (or still assigned, but were resolved or done) and has no time logged by him/her

Sorry, if my description confused you🙌

Bill Sheboy
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.
June 22, 2021

Hi!  I thought that was what I was suggesting, so here is a more complete example for one specific project.  Please add/adjust any additional criteria that you need.

project = myProject
AND ( assignee = currentUser()
OR assignee WAS currentUser() )
AND ( timespent IS EMPTY
OR ( timespent IS NOT EMPTY AND worklogAuthor != currentUser() ) )

Suggest an answer

Log in or Sign up to answer