Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,364,726
Community Members
 
Community Events
168
Community Groups

How to get last month issues

I want to have filter to get last month issues, i mean, now we are in May, I wan to get the issues which captured in Apr, Do you have function like Created = LastMonth() ? 

2 answers

7 votes
Jack Brickey Community Leader May 01, 2018

try this....

  1. create this filter: createdDate < endOfMonth(-1) and createdDate >= startOfMonth(-1)
  2. set up subscription to run monthly on the 1st of the month and email to you

Thank you for your prompt response, It worked out for me,

Hi,

Be mindful here this will not include the last day of the month so you'll need to amend the code to createdDate <= endOfMonth(-1) and createdDate >= startOfMonth(-1).

I did mine and went from 86 issues to 92 - when reviewing the rw output there was no data for the last day of the month hence the change.

Thanks

Like Jack Brickey likes this
Jack Brickey Community Leader Sep 16, 2022

@Jason Lane ,

I was just testing this and using my query and it does (and should) pick up the last day. I am curious and would like to clear this in my head. Can you inspect your results and find the delta between the two queries? Thanks!

Jack Brickey Community Leader Sep 16, 2022

Here is what I see....

1D0D6C66-1F27-4884-AF70-F287FF22BAE9.jpeg

Like Jason Lane likes this

Sorry i thought i had added to my post - I used a different date in mine and copied the wrong information over - Mine used was LiveDate <= endOfMonth(-1) and LiveDate >= startOfMonth(-1).

Interesting though that i had to make the change to the logic to get the information.

Sorry for the confusion. Jack is right with his but you need to ensure if you use a different date field that you check both.

Thanks

Afternoon

Be mindful here this will not include the last day of the month so you'll need to amend the code to createdDate <= endOfMonth(-1) and createdDate >= startOfMonth(-1).

I did mine and went from 86 issues to 92 - when reviewing the rw output there was no data for the last day of the month hence the change.

Thanks

Jason

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events