Hi - I need to search for issues created in the last month for a report dashboard, however the business rules of the company for reporting purposes is that their month ends on the last Friday of every normal calender month. I had been using
createdDate > startOfMonth(-1) and createdDate < endOfMonth(-1)
but it is naturally starting on the 1st and ending on either the 30th or 31st, as you would expect, so this is close, but not actually doing exactly what i need.
To give a specific example of what I need, in April of 2016, I want to filter for anything in the previous month. So based on the business rule that Friday is the last day, I want the filtered range to end Friday 25th March, but the tricky part is the start of the range is actually 27 Feb.
I need the filter to be reusable, so obviously cant hard code and dates etc. Any ideas as to how I could search for my custom period?
I don't think you can do this without a custom JQL function. Normally I would be suggesting writing your own with ScriptRunner, but there is a small bug that prevents using relational operators with custom functions. I've fixed it, but won't be released for a couple of weeks.
If you want to write your own see https://developer.atlassian.com/jiradev/jira-platform/building-jira-add-ons/jira-plugins2-overview/jira-plugin-module-types/jql-function-plugin-module, the important stuff for getting the last Friday of every month is in the getValues method. Code is at https://gist.github.com/jechlin/25557469af8b8013f62c6e4d3852be27.
So to get stuff resolved in the previous month you would use:
resolutiondate > endOfBusinessMonth(-2) and resolutionDate <= endOfBusinessMonth(-1)
Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...
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!
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