Hello:
I'm wondering what the query syntax would be to search custom date fields by month, regardless of year. For example, if we have two issues, one with a field value of "2019-02-01" and one with a value of "2016-02-08" both issues will be returned.
My thought is an advanced search would look something like this (where ~ represents any year):
CUSTOM_DATE_FIELD >= ~-02-01 AND CUSTOM_DATE_FIELD <= ~02-28 order by lastViewed DESC
Thanks in advance!
At the end of the day all we need to be able to do is use a custom date field's values to filter issues by the month coded in the custom date field. So we may have 5 issues with varying dates in, say, January (i.e., January 2, 2020; January 13, 2020; January 16, 2021; January 19, 2021; & January 4, 2023) we want to be able to tailor a simple filter that will return all of those issues (i.e., the 5 listed above).
We would like to avoid the manual process of coding both a custom date field and, say, a single value field with Jan, Feb, Mar, Apr, etc. values in them.
Another option would be to manually increment the years on the custom date field so that the year on the date field is always looking forward to the next year, but that again would be a manual process we would like to avoid.
One idea, if you have the ScriptRunner add-on installed, is to use a Script Field with a script of
issue.created.format("M")
which you could then use in JQL like
CUSTOM_DATE_FIELD_MONTH ~ 2
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for the quick response Payne, that would do it, but we do not have ScriptRunner installed :-/.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.