Search for issues that were created on previous month

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


1 answer

1 accepted

11 votes

You can try this:

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

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 ?


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).

I'm on Cloud Confluence ... can this be done in a Confluence Search URL? My trail and error has only led to error.... Eg."abcd"+and+lastmodified+<%3D+startOfMonth%28-12M%29+and+type+%3D+"page"


Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,755 views 11 18
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot