Using variables to calculate dates with Automation for Jira Data Center
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
If you try using A4J's standard syntax for Smart Values to manipulate date and time values using variables, you may come across issues with the rule results where the resulting date will be null.
Environment
Automation for Jira Data Center.
Solution
This occurs because the new and current A4J syntax does not support the use of variables in their date and time functions.
However, the old syntax available in the Archived date functions does support the use of variables.
Examples of Variable date calculation:
1
2
3
{{#now}}func=plusDays({{Variable}}){{/}}
{{#triggerIssue.Target Start.toDate}}func=plusBusinessDays({{Variable}}){{/}}
Was this helpful?