From 95eeb37c6c3d47536a424b9a35f84d2cef27066d Mon Sep 17 00:00:00 2001
From: mrsadman99 <60566490+mrsadman99@users.noreply.github.com>
Date: Tue, 1 Nov 2022 22:49:07 +0700
Subject: [PATCH] Exclude backlog issues from estimations (#2344)

Signed-off-by: Anton Brechka <anton.brechka@xored.com>
---
 .../src/components/sprints/SprintEditor.svelte            | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/plugins/tracker-resources/src/components/sprints/SprintEditor.svelte b/plugins/tracker-resources/src/components/sprints/SprintEditor.svelte
index 50f7f920c2..95ae71ff7d 100644
--- a/plugins/tracker-resources/src/components/sprints/SprintEditor.svelte
+++ b/plugins/tracker-resources/src/components/sprints/SprintEditor.svelte
@@ -55,6 +55,10 @@
 
   $: noParents = issues?.filter((it) => !ids.has(it.attachedTo as Ref<Issue>))
 
+  $: rootNoBacklogIssues = noParents?.filter(
+    (it) => issueStatuses.get(it.status)?.category !== tracker.issueStatusCategory.Backlog
+  )
+
   const statuses = createQuery()
   let issueStatuses: Map<Ref<IssueStatus>, WithLookup<IssueStatus>> = new Map()
   $: if (noParents !== undefined) {
@@ -66,7 +70,7 @@
   }
 
   $: totalEstimation = floorFractionDigits(
-    (noParents ?? [{ estimation: 0, childInfo: [] } as unknown as Issue])
+    (rootNoBacklogIssues ?? [{ estimation: 0, childInfo: [] } as unknown as Issue])
       .map((it) => {
         const cat = issueStatuses.get(it.status)?.category
 
@@ -93,7 +97,7 @@
       })
       .reduce((it, cur) => {
         return it + cur
-      }),
+      }, 0),
     2
   )
   $: totalReported = floorFractionDigits(