Forums

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

Narrow search for year 2022

John Pereira January 23, 2023

I am trying to write a JQL but it's not working in Jira. If I take the AND (resolutiondate = startOfYear("2022")) AND (resolutiondate = endOfYear("2022") ) the query works. I'm trying to ensure that I can only see tickets within 2022. 

("Customer Request Type" = "Hidden Onboarding (SUPPORT)" OR "Customer Request Type" = "Non-Employee - Onboard (SUPPORT)") AND (resolutiondate = startOfYear("2022")) AND (resolutiondate = endOfYear("2022") ).

 

 

1 answer

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Champion
January 23, 2023

Hello @John Pereira 

How exactly is the query not working?

Are you getting an error message? If so, what is it?

Is it not giving you the results you expect? If so please provide the details for an issue you expect to be in the results but is not appearing, for the following fields:

Custom Request Type

Resolution Date

John Pereira January 23, 2023

No errors. I just do not return anything. I'm trying to see all tickets I resolved between 1/1/22 till 12/31/22. I get no results when I try to set these dates. 

 

If I leave things as ("Customer Request Type" = "Hidden Onboarding (SUPPORT)" OR "Customer Request Type" = "Non-Employee - Onboard (SUPPORT)") I get tons of tickets 300+.. with various dates and years. 

Trudy Claspill
Community Champion
January 23, 2023

Your parameters for startOfYear and endOfYear are wrong. You should not specify a specific year. You need to specify an increment/decrement relative to the current year.

Refer to

https://support.atlassian.com/jira-software-cloud/docs/advanced-search-reference-jql-functions/#Advancedsearchingfunctionsreference-startOfYearstartOfYear--

You need to use 

startOfYear("-1")

endOfYear("-1") 

John Pereira January 27, 2023

Hi Trudy,

 

Thanks for your help. Still nothing. 

I tried: ("Customer Request Type" = "Hidden Onboarding (SUPPORT)" OR "Customer Request Type" = "Non-Employee - Onboard (SUPPORT)") AND (resolutiondate <= startOfYear("-1") AND resolutiondate >= endOfYear("-1") )

 

and 

("Customer Request Type" = "Hidden Onboarding (SUPPORT)" OR "Customer Request Type" = "Non-Employee - Onboard (SUPPORT)") AND (resolutiondate = startOfYear("-1") AND resolutiondate = endOfYear("-1") ).

 

No luck.

John Pereira January 27, 2023

I mess a bit with it and got it to work. 

I had to add this; AND resolution is not EMPTY AND duedate <= endOfYear("-1") AND duedate >= startOfYear("-1") 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events