Hi folks,
I need some help with a search. I know that I can use startOfMonth() and endOfMonth() to search tickets in this range. But what I need is a search between the 28th of a months and the 27th of the next months. So to speak my month will start on the 28th and not on the 1st and will end on the 27th and not on the 30th.
For example:
Issues created between 28.07. and 27.08.
But I will not have to change my query every month as I will need the same query again for the 28.08. - 27.09. and so on.
I hope this is quite understandable.
The best solution I can offer by just using a JQL query:
created >= startOfMonth(-34d) AND created <= endOfMonth(-35d)
However, this will only work with months with 31 days. You could create a separate JQL query for the months with 30th days and another to take into account February however this is not an optimal solution.
I think you may need to look into an add-on such as Script Runner.
Hope this helps
Hi Danny,
thanks for this fast reply! This query works fine for the last month but not for the current one. My problem is to find a query that is valid beyond the change of months.
Best regards
Julia
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I will shout out to the other Champions to see if they know of a method to achieve your requirements.
Apologies I cannot be any further assistance directly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Since the duration of month also varies (30, 31, 28 or 29 (leap year) days) thus hardcoding the days won’t always work
Scripting seems to be the possible solution
Please see here how to write an custom JQL function
https://scriptrunner.adaptavist.com/latest/jira/custom-jql-functions.html
Or a custom JQL plugin
https://developer.atlassian.com/server/jira/platform/adding-a-jql-function-to-jira/
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Java 8 time features (this will work in groovy as well)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.