Is this the proper syntax to calculate the number of months between two dates?
{{issue.Budget Coverage Period (Start date).diff(issue.Budget Coverage Period (End date)).months.abs}}
Thank you,
Hi @Madar, Andrew
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...
The syntax you show appears correct. To confirm, are those both date (or date / time) fields, and are those the correct smart values for the fields?
Smart values are name, spacing, and case-sensitive...and they often do not exactly match the display names of the fields on the issue pages. When an incorrect smart value is used, it is replaced with null and often fails with no errors.
To confirm you have the correct smart values (or custom field ids) for your fields, please use this how-to article:
https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/
Kind regards,Bill
Adding to this...
@Madar, Andrew Have you tried to use what you've shown? Did you get an error or an unexpected result?
I wonder if the parentheses within the field names might be causing problems?
Perhaps if those were replaced with the custom field ID instead, then the rule would work.
Budget Coverage Period (Start date)=2024-06-01Budget Coverage Period (End date)=2024-12-31
The value returned is 6.
It should be 7. I have to perform a plus 1.
The difference appears to be a mathematical difference (i.e., 12 - 6) and not an inclusive one, counting the end points.
It looks like you're new here. Sign in or register to get started.