Hi all,
I tried to create a rule that triggers when a task Original estimate or Planned start are modified, that automatically add the Original estimate (eg 1w 2d 3h) to the Planned date, if either are modified.
I did that by creating a variable TimeTrackingDays:
{{issue.timetracking.originalEstimateSeconds.divide(28800).floor}}
My idea was to extrapolate the seconds from the Original estimate field, divide it by the seconds in a working day (60*60*8), then using floor to round it down if there are spare hours, which i would put in the variable SpareHours:
{{#=}} ({{issue.timetracking.originalEstimateSeconds}} % (28800)) / (3600) {{/}}which would calculate the extra hours with the modulo operator %.
These two variables would then be added up to the Planned start date, like so:
{{issue.Planned start.plusBusinessDays(TimeTrackingDays.asNumber).plusBusinessHours(SpareHours.asNumber).jiraDate}}Problem is, while this may be conceptually correct, I must have made some syntax mistakes because the SpareHours part straight up bugs the rule, which works otherwise.
To solve this problem I tried a less polished solution, which is using the Ceil operator instead of Floor during the days calculation, so if there are spare hours they are automatically converted into a whole working day:
{{issue.timetracking.originalEstimateSeconds.divide(28800).ceil}}But this seems to not have any effect, which also make me question my use of the floor and ceil operators.
What can I do to solve this?