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

14 votes
Accepted answer

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 ?


It is JQL, not HQL ;) Here is the documentation:

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 Sign up to answer
Community showcase
Published 16 hours ago in Jira

How you can achieve compact and easy-to-maintain workflows in your JIRA( Server)

This approach requires you to have the JIRA administrative rights. The main aim of this article is to help you achieve an organized, easy-to-maintain workflows in your JIRA instance thereby, reducin...

151 views 0 0
Read article

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