Forums

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

Searching LastViewed Not Bringing Back Results

David Bounds
Contributor
February 3, 2020

Hello. I'm trying to use JQL to find tickets viewed on specific dates, or ideally within a date range. I understand it seems to be limited to 50 results but I'm actually not getting any results at all. Does JIRA not store this data for more than a certain number of days?

Query used for example: lastViewed = '2020-01-15'

This doesn't bring back any results, and neither does less than '2020-01-15'. If I do a greater than, it brings back the 50 most recent. I need to be able to find tickets that were viewed for a given date range in the past. Any help is appreciated! Thank you for your time!

3 answers

0 votes
David Bounds
Contributor
February 4, 2020

@John Funk Am I using the query incorrectly here? This is the same message I get when I try to define a date range in the past with <> where I know there should be tickets I viewed in that range.

2020-02-04 09_09_36-.png

John Funk
Community Champion
February 4, 2020

work with the numbers (bigger/smaller) to see if anything pops up. 

David Bounds
Contributor
February 4, 2020

@John Funk With lastViewed >= endOfWeek(-4) and lastViewed <= endOfWeek(-1)
I do get results back and this sort of illustrates my issue. I can't search for LastViewed beyond the past week even though obviously I've viewed tickets all year. Is there a limit? For example the above query only brings back results with lastViewed on 1/31/2020.

I'm trying to assist some team members with tracking hours and they sometimes need to review a specific days 'viewed' tickets to jog their memory. So far I can't find a query that actually brings back 'LastViewed' in further than the past week. 

John Funk
Community Champion
February 4, 2020

Here's the example they use

 

  • Find issues last viewed in January 2011:
    lastViewed > "2011/01/01" and created < "2011/02/01"
  • Find issues last viewed on 15 January 2011:
    lastViewed > "2011/01/15" and created < "2011/01/16"

Not sure why they use created but it seems to work. Change out the year and see what it does for you. 

0 votes
John Funk
Community Champion
February 4, 2020

Hi David,

You might try something like:

lastViewed >= endOfWeek(-4) and lastViewed <= endOfWeek(-2)

0 votes
Jack Brickey
Community Champion
February 3, 2020

You should reference this article which provides support syntax - advanced-search-reference-jql-fields 

in there you will find the following...

Supported functions

When used with the EQUALS, NOT EQUALS, GREATER THAN, GREATER THAN EQUALS, LESS THAN or LESS THAN EQUALS operators, this field supports:

  • currentLogin()
  • lastLogin()
  • now()
  • startOfDay()
  • startOfWeek()
  • startOfMonth()
  • startOfYear()
  • endOfDay()
  • endOfWeek()
  • endOfMonth()
  • endOfYear()

Suggest an answer

Log in or Sign up to answer