## Defect #24213 ### % Done is not correct for parent to parents when calculated from subtasks

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Issues planning
Target version:-
Resolution:Duplicate Affected version:3.3.0

Description

When having more than two levels of issues then when the % done is calculated for the top level parent then the subtasks on the first level always have equal weight instead of having a weight based on their total estimated hours.

Example:

```   P         - top level parent task
(40)       = total estimated time
/ \
/   \
A1    B1     - 1st level subtasks
(10)  (30)   = total estimated time
|\    |\
| \   | \
A2 A3 B2 B3  - 2nd level subtasks
3  7  9  21  = estimated times for 2nd level subtasks
```

The 2nd level subtasks each have an estimated time (A2=3h, A3=7h, B2=9h, B3=21h). The A subtree has a total of 10h and the B subtree has a total of 30h.

The 1st level subtasks calculate their % done using (sum of subtasks % done * estimated time)/(total estimated time).
So if A2 is closed(100%) then A1 has a done of 30 (A2+A3=10h, and 3h of 10h = 30%).

The total estimated time for the top level parent P is 40h. When only A2 is closed then the correct done for P should be 7.5 (3h of 40h), but it is actually showing the done for A1 divided by the total number of 1st level subtasks which is 30/2=15%.

I have created a patch that solves the problem, and it seems to work fine for us that have up to three levels of tasks and no more than 10 nodes total in a tree.

Related issues

 Duplicates Redmine - Defect #23511: Progress of parent task should be calculated using total ... Closed

### History

#### #1 Updated by Marius BALTEANUover 4 years ago

Did you try the fix from #23511?

#### #2 Updated by Toshi MARUYAMA over 4 years ago

• Status changed from New to Needs feedback

#### #3 Updated by C-O Lover 4 years ago

Yes #23511 should fix this problem, sorry I didn't find that issue before posting.

#### #4 Updated by Toshi MARUYAMA over 4 years ago

• Status changed from Needs feedback to Closed
• Resolution set to Duplicate

#### #5 Updated by Toshi MARUYAMA over 4 years ago

• Duplicates Defect #23511: Progress of parent task should be calculated using total estimated hours of children added

Also available in: Atom PDF