The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

Search for issues that were created on previous month

Christophe NOVARRO
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 26, 2014

I would like to know how to refer to previous month in a HQL Jira. For exemple,

JIRA bug open on the previous month

for exemple, in january, I untersdood the HQLwas :

project = XXX AND issuetype = Bug AND created >= 2013-12-01 AND created <= 2013-12-31

but, each month, i can modify the request, for exemple, in feb., i will write :

project = XXX AND issuetype = Bug AND created >= 2014-01-01 AND created <= 2014-01-31

what is the solution for to have a generic request for to have bug open the calendar on previous month, not to have bug for relative day (created > "-31d") or fixed date (created >= 2014-01-01) !

thank you for your help

Regards

1 answer

1 accepted

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

15 votes
Answer accepted
Jobin Kuruvilla [Adaptavist]
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 Champions.
January 26, 2014

You can try this:

project = XXX AND issuetype = Bug AND created &gt;= startOfMonth(-1) AND created &lt;= endOfMonth(-1)

Christophe NOVARRO
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 26, 2014

I try and it's OK ! thank you very much for your help !

Is there any documentation with standard function which is possible to use in JIRA HQL, such as startOfMonth ?

Regards

Jobin Kuruvilla [Adaptavist]
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 Champions.
January 26, 2014

It is JQL, not HQL ;) Here is the documentation: https://confluence.atlassian.com/display/JIRA/Advanced+Searching

Bruce von Kugelgen
January 26, 2016

Great tip--it's easy to forget that those functions like startOfMonth() can accept parameters–the Atlassian documentation doesn't make that clear (to me).

Like livin-tpm likes this
Chris Wallingford
May 24, 2017

I'm on Cloud Confluence ... can this be done in a Confluence Search URL? My trail and error has only led to error.... Eg.

https://abcd.atlassian.net/wiki/dosearchsite.action?cql=space+%3D+"abcd"+and+lastmodified+<%3D+startOfMonth%28-12M%29+and+type+%3D+"page"

Thanks!

TAGS
AUG Leaders

Atlassian Community Events