I want to set up an automation that calculates the end date of an issue automatically based on the original estimate.
I already have a separate automation that updates the Start Date field when an issue is moved into the "In Progress" Status but the various rules I have tried to calculate the Due Date either do nothing or come back with "some errors" in the audit log.
I think one of the issues is that Jira cannot find the fields:
Time Tracking or Original Estimate
I've tried a few work arounds but they are not working either.
Another issue could be my expression below.
The Smart Variable for {{calculatedDueDate}} is:
{{issue.Start Date.plusDays(issue.timeoriginalestimate.divide(6h).toNumber)}}
Some context, the estimate we are working with is 1 working day = 6 hours.
I am new to setting up automations so I might be missing some foundational knowledge that could solve this.
@Christian Tarzia
Use the Original Estimate in seconds and add business days to Start Date; then set Due date with one calculation, not chained methods like divide(6h) which isn’t valid in Jira automation smart values. Also ensure Time tracking is enabled and the Time tracking field is on your create/edit screens, otherwise Original estimate isn’t accessible to rules and you’ll see vague “some errors” audit entries
Use below smart values for estDays and Duedate
{{issue.Start date.plusBusinessDays({{#=}}
{{issue.timetracking.originalEstimateSeconds}} / 21600{{/}}).toBusinessDay}}
Thanks
Jayesh R
Hello @Christian Tarzia
have this requirement on my instance and wanted to share with you the smart value I am using:
Due date = Start date + Original estimate (in business days)
{{issue.customfield_11256.plusBusinessDays(issue.timetracking.OriginalEstimateSeconds.divide(28800).round)}}
11256 is the custom field ID for my start date.
You will need to adapt this to your own context, but basically, I am using this smart value as described in the following link. https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/
Hop this can help
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Your rule is almost correct. The main problem is the smart value, because timeoriginalestimate is stored in seconds and 6h is not valid syntax in Jira expressions.
Try this:
In the “Create variable” action, set calculatedDueDate to:
{{issue.Start Date.plusDays(
issue.timeoriginalestimate.divide(3600).divide(6).toNumber
)}}
In the “Edit issue fields” action, set Due date to:
{{calculatedDueDate}}
In the condition before that, make sure the rule only runs if the issue actually has an Original Estimate. For example:
{{issue.timeoriginalestimate.asNumber}}
Condition: greater than
0
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Ignacio Vera I tried using this method but it does not seem to work or at least the rule does not trigger at all, according to the audit log.
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.