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" .
What type of field is the customfield_10026? And what do you expect this subtraction to yield? {{customfield_10026.diff(now).prettyPrint}}
On my instance, that specific field is Request Participants, and yes all results are the same. It makes sense though (I would produce an error to be exact).
On my side, customfield_10026 is a Due date picker (for some reason some tickets used only "Due date" and some used only "Due date picker", so I must check these both fields)
Results example, from API response:
...
customfield_10026: "Due Date picker"
...
customfield_10026: "2022-09-15"
...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok. Let me create a due date picker custom field and adjust my automation as well
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Nicolay Subbota first of all I can confirm that this is...hmm...troublesome :)
I did all the necessary tests, and indeed the now.diff(customDATETIME) returns null. I've tried endless combinations to get this thing work, but none yield any result. It's safe to say that this is a bug and should be addressed to Atlassian's attention.
Unfortunately I wasn't able to find a workaround:
I didn't manage to find a workaround :(
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.