Forums

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

Smart Values Date Diff function is not working

Ersel Bora
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!
January 16, 2024

Hi everyone,

I have 2 date variables. When I try to get the "diff" in any format(milisec,seconds, days,weeks etc), the result returns empty. Is it a known issue or bug?  I put the logs below;

Log action
Log
date 1: 1970-01-01T00:00:00.0+0000

Log action
Log
date2: 2023-12-01T00:00:00.0+0000


Operation: {{date2.diff(date1).days}}

Log action
Log
Diff in Days:

1 answer

0 votes
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.
January 16, 2024

Hi @Ersel Bora -- Welcome to the Atlassian Community!

For a question like this, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected.  Those will provide context for the community to offer ideas.  Thanks!

Until we see those...

Some date (and date / time) fields in Jira are treated as text in automation rules.  There is no clear documentation for why some fields do this.  And, there are fields which look like date / time values which are in fact text type.  (e.g., statusCategoryChangedDate)

To perform date functions on these they must be converted using toDate first.  For example:

{{issue.statuscategorychangedate.toDate.diff(now).days}}

Perhaps try writing your fields to the audit log to confirm they contain the values you expect, and then adding toDate for conversion.

Kind regards,
Bill

Suggest an answer

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

Atlassian Community Events