It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

JQL for birthday

Hi!

I have a custom field in Jira cloud for birthdays and I'd like to construct a JQL to filter out everyone who has a birthday today. Is that possible in some easy way?

2 answers

0 votes

Hi @Henrik Åmark 

I think you should clarify a bit more. If you have a date custom field named Birthday and you have issue per person setting the Birthday, you can use jql like below:

Birthday >= startOfDay() and Birthday <= endOfDay()

You are spot on with your assumptions. I have a custom field on each issue for entering a birthday. The JQL you provided works if the birthday is today, but will not work next year as it will include the year as well. Or did I miss something?

Hi @Henrik Åmark 

Sorry for the late response. And yes, you're 100% right, the year part would be a problem for my Jqls. And as far as I know, this can't be achieved without a script or app.

0 votes

Hi @Henrik Åmark

To clarify, you're looking for all issues (which represent users) who don't have a birthday today - so a JQL for day and month which ignores year (given that year could be anything in a 100 year spread)?

This isn't something which is possible with base JQL, as it searches for specific dates - eg. startofDay() assumes that is today in 2019, not today in any year.

You'd need to consider a scripted field or similar which can identify if today is a user's birthday using the day and month. An app like ScriptRunner should allow you to do this. I'm not so hot on ScriptRunner Cloud though so best to read through the vendor's support page or contact them directly with that question!

A simple alternative is to set their birthday each year to the actual date - for example:

  • Locate all issues with a Birthday date of 03/12/2019 - set as this regardless of their date of birth
  • Filter them out using the query from Tuncay above
  • Once you reach the end of 03/12/2019, locate all those users with that specific date and change it to 03/12/2020 for the next year.

More manual, but a simpler fix.

Let me know if this was not the issue or the field isn't on an issue-level but a user-level.

Ste

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted in Jira Core

How to manage many similar workflows?

I have multiple projects that use variations of the same base workflow. The variations depend on the requirements of the project or issue type. The variations mostly come in the form of new statuses ...

1,599 views 8 2
Join discussion

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you