Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Inconsistency in Year vs. Quarter for December 31

Casey Gould
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 2, 2024

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?

 

Related: Jira dates smart values documentation

2 answers

1 accepted

0 votes
Answer accepted
Casey Gould
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 4, 2024

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

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 4, 2024

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

Casey Gould
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 7, 2024

Thanks, Bill. That makes a lot more sense!

Like Bill Sheboy likes this
0 votes
Dan Breyen
Community Champion
October 2, 2024

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.

 

Casey Gould
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 2, 2024

Submitted, thanks.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events