Hi everybody,
In a JIRA Automation rule, I create intermediate variables to work and manipulate dates comming from custom fields. However, I find it impossible to use the date functions (as .diff for example) with these variables.
For example, something like {{mydate2.diff(mydate1).days}} returns a null value. I checked the value of mydate1 and mydate2 with a log just above, to be sure these variables are well filled.
I also tried to recast these variables as dates to be sure to work on dates, as mentionned in the documentation: mydate1 = {{mydate1.toDate}} and mydate2 = {{mydate2.toDate}}, but this changes nothing.
Is there any known issue with this? Any tips?
Thanks
Cédric
Hi @Cédric Cox
If I am understanding your question, you are using created variables within the rule and the date functions are not working. Is that correct?
If so, I suspect that the created variables are strings, and so you may need to convert them to a date first, such as with {{myVariable.toDate}}
You may check progress when building rule formulas by using the action Log to write to the audit log and see the results.
Best regards,
Bill
Hi @Cédric Cox,
Can you try to use the diff with .seconds instead of .days?
{{mydate2.diff(mydate1).seconds}}
I've had issues with durations that were < 1 day, resulting in the diff value being null. For example:
Hope this helps,
- Manon
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.