Hello everyone !
I have created an Automation rule that sets the OriginalEstimate of a task as the sum of the OriginalEstimates of its subtasks.
I am trying to change it or add a new rule to do the same thing for an Epic, adding the OriginalEstimates of its children.
The "Edit Issue Fields" sets the issue's OriginalEstimate with this smartvalue :
{{issue.subtasks.timetracking.originalEstimate.sum}}
Since it's in a branch where the parent is select, the issue that is modified (and the one chosen as {{issue}} ) for the smartvalue is the parent.
The rule trigger is a manual trigger used in on of the substask, for testing purposes. I plan to change that so the rule triggers when the original estimate of a subtask is modified.
As I said, this rule works to calculate the OriginalEstimate of a task as the sum of its subtasks, but it does not let me calculate the OriginalEstimate of an epic as the sum of its tasks.
The problem seems obvious, since the smartvalue takes the parent issue's "subtasks" to sum their OriginalEstiates, but it is not possible to replace "subtasks" with a more generic "children", as that smartvalue does not exist.
I used this documentation to check for properties, but even it does not seem to contain every possible issue property (subtasks does not appear, for example)
Is it possible to change (or clone and edit) this rule to make it affect an Epic, calculating the sum of its children's OriginalEstimates ?
I think it could be possible to do it by changing the whole rule, using a branch to check the children of an epic, but then I don't know how to get the epic as the {{issue}} which would be taken as the root of the branch, nor do I know how to add that sum to a variable available outside of the branch.
Other possibly relevant info :
I am using Jira cloud and this is a team-managed project
The log you can see is just for debugging purposes and showed me the Epic as the parent when I triggered that rule from a task but 0 as the sum, because {{issue.subtasks}} does not return anything for an Epic.
Finally, I am using OriginalEstimates instead of OriginalEtimatesSeconds which I have seen in other places because it seems to work without having to divide anything to work with the default setting of my project 'estimates in Days).
Any help with that would be greatly appreciated.
PS : I used that forum thread as a base for my current rule.