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
What is the source of the expression you suggested? Did you test that?
That expression cannot work in Jira Automation rules as it attempts:
As a reminder, when posting bot / AI-generated content, the source should be disclosed and validated before use. To learn more, please see the Atlassian Community Guidelines:
https://community.atlassian.com/forums/custom/page/page-id/rules-of-engagement
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
Hi @Christian Tarzia -- Welcome to the Atlassian Community!
The expression you tried has a few problems to fix before it can work...
If you use this how-to article from Atlassian, you will find the correct smart value for the Original Estimate field is:
{{issue.timetracking.originalEstimateSeconds}}
Next, smart values are name, spacing, and case-sensitive...and often do not match the name displayed on the Jira pages. The correct smart value for the "Start Date" field is:
{{issue.Start date}}
And, date / time, increment functions in rules take number parameters, and cannot interpret something like divide(6h).
Next, there is no toNumber function. There is an asNumber function to convert text values to a number, but that is not needed for your case.
Finally, the Due Date field is a date field, not a date / time. When a rule sets it using a smart value expression, you may reduce the chance of errors by forcing it to a text format of .jiraDate and letting Jira handle the conversion.
Putting all that together, please try this expression:
{{issue.Start date.plusDays(issue.timetracking.orginalEstimateSeconds.divide(21600).round).jiraDate}}
Where the division value is the number of seconds in your 6 hour / day =
6 h * 60 m/h * 60 s/m = 21600
The round function is strictly not necessary at this time, but if Atlassian solves an existing defect with smart value division, adding the round will prevent future problems.
Kind regards,
Bill
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.