Forums

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

Days Overdue Calculated Field Not Taking into Account Year

Rebecca Hagerty
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 27, 2023

Hello,

I am trying to create a calculated field that shows the number of days a task is overdue.

My current automation is:

{{now.diff(issue.dueDate).days.abs}}

However, the problem is it isn't calculating properly. I have one due date that was in 2023, but it's calculating everything as if it was this year. How can I fix this?

1 answer

1 accepted

2 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 27, 2023

Hello @Rebecca Hagerty 

Welcome to the Atlassian community.

Can you show us your entire automation rule, please? Sometimes the results are unexpected due to the context in which a given step is executing.

Have you tried adding Log actions to your rule to print the {{issue.dueDate}} value into your rule execution Audit Log, to confirm the field has the value you think it should have?

What is an example of a dueDate used in this calculation and the result of the calculation that you think is incorrect?

Rebecca Hagerty
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 27, 2023

Thank you for the reply. It is logging the correct date in the audit log, but calculating like the date is 2024.

 

2023-12-27_14-06-11.jpg2023-12-27_14-06-39.jpg2023-12-27_14-08-00.jpg

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 27, 2023

Hello @Rebecca Hagerty 

I don't see the error.

The difference in days between Aug. 21, 2023 and today (Dec. 27, 2023) is 128 days.

August 21-31 = 10 days

September = 30 days

October = 31 days

November  = 30 days

December current day = 27

10+30+31+30+27=128

128 is the value shown in Days Overdue.

What value do you think should be in that field?

Suggest an answer

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

Atlassian Community Events