Forums

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

How do I use Previous Month?

Jeff Thomas June 25, 2019

I'm trying to look for Status Changes in the month previous to the month we are in. How do I write this?

 

So far I've got this but not sure if it's correct? For example today should show me May's data and when I rerun this in July it should show me Junes data.

 

Project = STCBP AND status changed during (EndOfMonth("-1m"),now())

3 answers

1 accepted

4 votes
Answer accepted
Ilya Turov
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.
June 26, 2019

EndOfMonth() is exactly what it is - end of current month, so EndOfMonth("-1M") gonna be one month before it which is actually startOfMonth()

Also be careful with -1m, since its actually one minute, one month gonna be 1M

so for the issues that changed their status during the previous month I'd use this:

status changed during (startOfMonth("-1M"),startOfMonth())

Jeff Thomas June 26, 2019

Thank you. This one seems to work... good trick about the "m" vs "M"

project=STCBP and status changed during (startOfMonth("-1M"),startOfMonth())

But since I'm loading everything this month, I'm assuming no results is a pass

 

How do I use the same for created and/or updated ? Both the below fail for me, it says "The Jira server didn't understand your search query."

project=STCBP and created during (startOfMonth("-1M"),startOfMonth())

or

project=STCBP and updated during (startOfMonth("-1M"),startOfMonth())

 

Jeff

Ilya Turov
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.
June 26, 2019

created > startOfMonth("-1M") and created < startOfMonth()

same with updated

Like # people like this
Jeff Thomas June 26, 2019

Thank you for all your help.

0 votes
Shreya Parekh December 12, 2024

Hi Jeff

Not Sure if you are looking for the last month data or past 1 month data, but what i used for the query to retrieve past 1 month data i.e November 12 - December 12  is 
Project = XXX AND Createdate >= Startofday(-1M). 

Hope this helps :)

 

0 votes
PVS
Banned
June 25, 2019

Hi @Jeff Thomas 

 

There is one way you can filter as the last month or the last two month etc...

Ex:

 project = "Project" and status changed during (2019-05-01, 2019-05-30) FROM ("Status 1") TO ("Status 2")

OR 

 

project = "Project Name" AND status changed FROM "Status 1" TO "Status 2" DURING ('2019-05-01', '2019-05-30') BY "username"

 

 

Thanks 

Jeff Thomas June 25, 2019

Thank you, but I don't want to have to hard code dates... I want to use references to "Last Month" or "Previous Month".

PVS
Banned
June 26, 2019

Basically With out dates 

This way you can search between certain dates, by user and by field.

I don't think that you can With out Dates 

I hope this helps somewhat

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events