Automate Due date of an issue from Original Estimate
Platform Notice: Cloud, Server, and Data Center - This article applies equally to all platforms.
Summary
Customers want to be able to automate the 'Due Date' field so that when developers work on the issue and transition it to "In Progress", and the due date is empty, then set the 'Due date' to when it's transitioned, so set Due date to now + 'Original estimate'. Or in some scenarios, customers want to calculate the 'Due date' field based on 'Start date' + 'Original estimate'.
This article shows how to automatically set the 'Due date' from 'Original estimate' using Automation for Jira
Environment
Automation for Jira
Cause
The Date and time math functions available in Automation for Jira does not support nested smart values. Here are the relevant feature request to provide that option: AUT-1473 and AUT-1063
Solution
Here are the steps to achieve this:
- Decide and choose a trigger that should set the 'Due date' field for an issue. Let's say for this article we want to update the 'Due date' as 'Start date' + 'Original estimate' when an issue is created
Choose the action Create variable to store the time tracking estimate in business days using the below query:
{{#=}}{{issue.timetracking.originalEstimateSeconds}} / (60 * 60 * 8){{/}}
Proceed with Edit action to update the 'Due date' with the 'Orginal estimate' to days value added to the 'Start date':
{{issue.Start date.plusBusinessDays(TimeTrackingDays.asNumber).jiraDate}}