プロジェクト

全般

プロフィール

Vote #76978

未完了

Automatic done ratio calculation in issue tree is wrong when parent has its own estimated time

Admin Redmine さんが約2年前に追加. 約2年前に更新.

ステータス:
New
優先度:
通常
担当者:
-
カテゴリ:
Issues_2
対象バージョン:
-
開始日:
2022/05/09
期日:
進捗率:

0%

予定工数:
category_id:
2
version_id:
0
issue_org_id:
21449
author_id:
115781
assigned_to_id:
0
comments:
3
status_id:
1
tracker_id:
1
plus1:
0
affected_version:
closed_on:
affected_version_id:
102
ステータス-->[New]

説明

Due to the change in r14272 estimated_hours are now independent for parent and subtasks. But, it seems that automatic calculation of done ratio is still based on estimated time of children, ignoring value provided for the parent.

e.g.

  • A (2h) ** B (2h) *** C (2h) 50% done

This results with 50% done ratio on all tasks up to A, what, from estimated time point of view, is wrong - only 1 of 6 hours is "done".

I do not see a fix for this when automatic done ratio calculation is enabled as there is no way to say that some work on parent has been also done. Anyway, latest changes leads to inconsistency


journals

--------------------------------------------------------------------------------
This issue still exists in Redmine 4.1.0 and this is big issue. Don't know why none complains about this.
--------------------------------------------------------------------------------
It seems that the equation in <code>recalculate_attributes_for</code> has to be changed to include the estimate time of the issue to:

<pre><code>
total_estimated = p.estimated_hours.to_f || 0.0
children = p.children.to_a
if children.any?
if p.closed?
p.done_ratio = 100
else
done = children.map {|c|
estimated = c.total_estimated_hours.to_f
total_estimated += estimated
ratio = c.closed? ? 100 : (c.done_ratio || 0)
estimated * ratio / 100.0
}.sum
progress = ((total_estimated - done) / total_estimated) * 100
p.done_ratio = 100 - progress.floor
end
# ancestors will be recursively updated
p.save(:validate => false)
end
</code></pre>

The problem with this is that this will correctly update "% Done" of all parents (A) recursively but it will not update "% Done" of currently edited issue (B) if the issue is also a parent (for C).

I have tried moving this recalculation to before_save callback, so that it can modify the issue (B) and this works correctly, "% Done" of current issue (B) and all parents (A) is updated.

This creates though small inconsistency in journals. Normally updates to derived "% Done" are not save into journal. But in the case, when issues (B) is edited and it has derived "% Done" (because it is parent for C), the new "% Done" value gets saved into journal. This is not OK as the "% Done" may be changed at any time if any subtask (C) is modified - since this operation is not be saved in journal, now the issue (B) shows different value of "% Done" then visible in last journal entry. So, confusing. And I don't know how to solve this problem.
--------------------------------------------------------------------------------


related_issues

relates,Closed,16092,Parent/subtask: calculation of estimated hours

Admin Redmine さんが約2年前に更新

  • カテゴリIssues_2 にセット

他の形式にエクスポート: Atom PDF

いいね!0
いいね!0