Let's say i am editing a field name "DiffDate"
DiffDate = {{now.compareTo(issue.customfield_10304)}}
now = August 17, 2023
Customfield_10304 = September 1, 2023
I expected that the result would return "-15" (minus fifteen), but i notice "-1" instead.
If i change the Customfield_10304 to August 31, 2023, i would get "-14" (2 week earlier from now) which is correct as i expect.
I wonder why compared date result that is less than -14 will return to -1 instead?
Kindly let me know if i do it wrong. Thanks guys.
Hi @Boyd Hong
The compareTo() function returns -1, 0, or 1, indicating the ordering of the dates: https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/
If you want the days difference, please use the diff() function instead:
{{now.diff(issue.customfield_10304).days}}
Kind regards,
Bill
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.