Can a JQL query include a Last Month date range?

Colum McAndrew
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.
December 14, 2023

I've a dashboard that includes a filter that uses a time period to produce results. The filter aims to list issues that have moved to a Done status in the last calendar month. It uses a statusCategoryChangedDate range, for example: 

statusCategoryChangedDate > "2023/11/01" AND statusCategoryChangedDate < "2023/11/30"

The issue is that I have to amend the date range each month. Is there a way to dynamically enter the date range, so I don't have to manually change the dates all the time? For example, LastMonth.

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.
December 14, 2023

Hi @Colum McAndrew 

Your JQL could use the startOfMonth() and endOfMonth() functions, with the modifiers to subtract one month: 

project = myProjectName
AND statusCategory = Done
AND statusCategoryChangedDate >= startOfMonth(-1)
AND statusCategoryChangedDate <= endOfMonth(-1)

Please look here to learn more about those functions:

https://support.atlassian.com/jira-software-cloud/docs/jql-functions/#startOfMonth--

Please note: This will find the issues which are currently Done and moved to that condition last month.  It will not find issues which moved to Done and which are no longer Done.

To find those, please try using the CHANGED operator with the DURING modifier:

https://support.atlassian.com/jira-software-cloud/docs/jql-operators/#CHANGED

Kind regards,
Bill

Colum McAndrew
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.
December 19, 2023

Many thanks @Bill Sheboy That is exactly what I was after.

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events