Community...
I am using an instance of JIRA to manage the registration of people supported by an NGO that helps people who are going through needs.
One of the custom fields that creates the date picker type and is populated with the date of birth.
I'm trying to create a JQL query and list the problem that has the birthday date for the current month, but I'm not getting ...
Can someone help me?
project = cb and "date of birth" >= startOfMonth() and "date of birth" < endOfMonth(1)
I made some changes to the original question.
Does anyone have any ideas?
I think you'd need to code a JQL function to do this, or code a scripted field that pulled the month out separately.
The problem for you with the start and end functions you have tried to use is they really do mean "the current month" (or +/- x months), and they look at the whole date. April last year won't be returned in start/end because it was last year.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I realized this but as the startyear function exists, I thought it would look exclusively for the month.
I also own the scriptrunner, could you help me with this script that isolates me only the month of this date field?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ah, well that makes it easy. I'm not so hot on JQL functions. or even coding, but a scripted field will do the job:
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.component.ComponentAccessor
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def birthdayField = customFieldManager.getCustomFieldObjects(issue).find {it.name == "Birtday field name"}
return issue.getCustomFieldValue(birthdayField).getMonth()
This assumes the field is always filled, and you want a 1-12 number back from the date.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Nic
Yes, it is populated in the creation of the issue.
Many thanks for the help, I can not test at this time, but I put the result here as soon as possible.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Please go easy on my coding skills - I have not been a real developer since 2004, and even then I wasn't writing Java or Groovy (Pro-IV in case you've ever heard of that). I wrote that from memory, but I think it's broadly correct.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ONG: Abbreviation in French, Italian, Spanish, Romanian and Portuguese for non-governmental organization (NGO in English)
Perhaps:
project = cb and "date of birth" >= startOfMonth() and "date of birth" < endOfMonth(1)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Tanks Matt,
Sorry, I was wrong to enter information, I already tested that way and it does not work, it seems that it is also taking the year into consideration
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.