In a Jira automation, I'm pulling the date from the due date field, converting it to a year-quarter format, and adding it as a label (if not already present).
Ex: If the due date is December 31, 2024, then the automation should add the label '2024Q4'
The automation is working fine so far except for December 31, 2024.
I've been burned by how Jira stores dates in GMT before, but what's weirder to me is that it's inconsistent here.
The Jira Smart Value (setting a variable in the automation):
{{duedate.format("YYYY")}}Q{{duedate.format("Q")}}
If 2024-12-31 is getting stored as 2025-01-01 GMT under the hood, I can understand why the YYYY format would return 2025.
What doesn't make sense to me is that the value above is returning 2025Q4.
Why would .format("YYYY") return 2025 if .format("Q") is still returning Q4?
I received an answer from Atlassian Support. Pasting it here, although it's not clear to me the reasoning:
Hi Casey,
Thank you for reaching out and for sharing the details of the issue you're experiencing with your Jira automation. My name is Diego and I’ll assist you with this issue.
To ensure your automation works as intended, please try using a lowercase 'y' in your format string.
It seems there might be a small typo in your current setup.
Instead of using:
{{duedate.format("YYYY")}}
please use
{{duedate.format("yyyy")}}
The lowercase 'y' should give you the correct year value without the inconsistency between the year and quarter.
This adjustment should help align the results with your expectations.
If you continue to face issues or have any other questions, please don't hesitate to reach out.
We're here to help!
Thank you for your patience and cooperation.
Kind regards,
Diego Leitão
Atlassian Cloud Support
Hi @Casey Gould
The symbol Y is for the week-based-year and the y symbol is for the year-of-era.
https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html
Some usages need the year to be based on the whole weeks, Monday-Sunday, while others need the calendar year. And so the two could vary by -1 to +1 years.
Please see the ISO spec on date / time data if you want to learn more.
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks, Bill. That makes a lot more sense!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Casey Gould I took a quick look at Atlassian's Jira Site and didn't see any issues related to that. If you can reproduce it at will, I'd probably contact Atlassian Support and have them weigh in. It sounds like a code issue to me, but that's my opinion.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Submitted, thanks.
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.