Hi!
I try to configure some conditions based on manipulation with date.
I used this documentation - https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/ and https://support.atlassian.com/cloud-automation/docs/jira-smart-values-issues/
My example:
Total issues with hot due date: <b>{{lookupIssues.size}}</b>
{{#lookupIssues}}
• <a href="{{url}}">{{key}}</a> <b>{{summary}}</b> <font color="darkolivegreen">[{{issueType.name}}]</font>
Assignee: <b>{{assignee.displayName}}</b>
This issue was updated at {{updated.longDate}} and has status <b>{{status.name}}</b> with priority <b>{{priority.name}}</b>
{{#if(and(exists(duedate),now.isAfter(duedate)))}}
Due date: {{duedate.longDate}}
<font color="red">Overdue: <b>{{duedate.diff(now).prettyPrint}}</b></font>
{{/}}
{{#if(and(exists(duedate),now.isBefore(duedate)))}}
Due date: {{duedate.longDate}}
<font color="green">On time: we have <b>{{now.diff(duedate).prettyPrint}}</b></font>
{{/}}
{{#if(and(exists(customfield_10026),now.isAfter(customfield_10026)))}}
Due date picker*: {{customfield_10026.longDate}}
<font color="red">Overdue: <b>{{customfield_10026.diff(now).prettyPrint}}</b>*</font>
{{/}}
{{#if(and(exists(customfield_10026),now.isBefore(customfield_10026)))}}
Due date picker*: {{customfield_10026.longDate}}
<font color="green">On time: we have <b>{{now.diff(customfield_10026).prettyPrint}}</b>*</font>
{{/}}
<hr>
{{/}}
---
For case "Overdue" when used "duedate.diff(now)" - all is ok, the calculation is correct.
But for case "On time" when used "now.diff(duedate)" - I have an issue with calculations - only first value is correct, and the following values are the same as the first one - please refer to picture when 5th and 6th values are wrong and must be "1 day" and "4 days" .
