Metrics for Bugs in User Stories and Features

User Stories and Features in Targetprocess may contain related Bugs. Predefined calculations of total effort and time spent in User Stories and Features do not include related Bugs. This article describes how to configure custom calculations and summarize bugs' details properly.

The following metrics can be configured per User Story and per Feature:

  • Bugs Count, Tasks and Bugs Count
  • Bugs Effort, Total Effort including Bugs
  • Bugs Time Spent, Total Time Spent including Bugs
  • Bugs Cost, Total Cost including Bugs

To build reports having all nested items processed properly use custom calculations based on custom formula metrics or Visual Reports calculations.

It is possible to perform the custom calculations via Visual Reports calculations. Results are displayed in reports only. Calculations can be configured and modified by any Targetprocess user (report owner). The reports are described in dedicated articles, for example:

To get calculated totals displayed in detailed views, enable filtering and grouping in Targetprocess views and legacy tabular reports, add custom calculations for work items and high-level planning entities. The custom calculations are done by Custom Formula Metrics. They can be configured and modified by Administrators only.

Improperly configured calculations may be not accurate enough. Verify the reports before using them for billing and invoicing purposes. Use non-verified reports on your own risk.

Data Model

User Stories in Targetprocess may contain Bugs. Bugs are displayed on Bugs tab. Parent User Story of a Bug is displayed in Info section in its detailed view.

Data Model. Image 1

Features in Targetprocess may contain Bugs as well. Bugs are displayed on Bugs tab. Parent Feature of a Bug is displayed in Info section in its detailed view.

Data Model. Image 2

As result, Bugs in Targetprocess can be related to Features directly, or within intermediate User Stories, or both ways.

Direct parent Feature of a Bug and parent User Story's parent Feature may be two different Features.

To avoid unintended duplication in total calculations, all the possible cases should be processed carefully.

Data Model

[1] Bug is related to a Feature within related User Story

[1] Bug is related to a Feature within related User Story

[2] Bug is related to a Feature directly, there is no related User Story

[2] Bug is related to a Feature directly, there is no related User Story

[3] Bug is related to a Feature directly, related User Story has no parent Feature

[3] Bug is related to a Feature directly, related User Story has no parent Feature

[4] Bug is related to a Feature directly, related User Story has the same parent Feature

In this case, total bugs count / effort / time spent / cost for the Feature should include the Bug just once, not twice.

[4] Bug is related to a Feature directly, related User Story has the same parent Feature

[5] Bug is related to a Feature directly, related User Story has other parent Feature

In this case, total bugs count / effort / time spent / cost for both Features A and B should include the Bug.

[5] Bug is related to a Feature directly, related User Story has other parent Feature

Metrics Hierarchy

The solution is based on custom calculations. It uses custom fields and custom formula metrics.

Changes described below are performed by Administrators.

Here is how we recommend to set up hierarchy of custom calculations to process all the cases carefully and avoid duplications:

  1. Set up custom calculation on User Story level. Summarize values in nested Bugs. It processes cases [1], [3], [4], [5] for User Stories.
  2. Build first part of custom calculation on Feature level. Summarize custom values in nested User Stories. It processes cases [1], [4] for all the Features and [5] for "Feature A".
  3. Build second part of custom calculation on Feature level. Summarize values in nested Bugs. Set up advanced filter to exclude case [4]. It processes cases [2], [3] for all the Features and [5] for "Feature B".
  4. Set up custom calculation on Feature level. Summarize the two parts together.

Add multiple metrics one by one. Once a metric is added, watch its computation status. Start to configure next custom formula metric only when completion status of the previous one is 100%.

1. Metrics for Bugs in User Stories

Prerequisites:

  • Add corresponding numeric system custom fields on User Story level in advance.
  • To sum Costs of Bugs, add numeric system custom field "Cost" on Bugs level and set up corresponding costs calculations in advance.

Set up these custom calculations as custom formula metrics for numeric system custom fields on User Story level.

Custom FieldCustom Field TypeCustom Formula Metric
Bugs CountNumber, SystemBugs.Count
Bugs EffortNumber, SystemBugs.SUM(Effort)
Bugs Time SpentNumber, SystemBugs.SUM(TimeSpent)
Bugs CostNumber, SystemBugs.SUM(CustomValues.Number("Cost"))

2. Metrics for User Stories in Features

Use these custom formulas as parts in further complex calculations.

[Feature]
"US Bugs Count": UserStories.SUM(CustomValues.Number("Bugs Count"))
"US Bugs Effort": UserStories.SUM(CustomValues.Number("Bugs Effort"))
"US Bugs Time Spent": UserStories.SUM(CustomValues.Number("Bugs Time Spent"))
"US Bugs Cost": UserStories.SUM(CustomValues.Number("Bugs Cost"))

3. Metrics for Bugs in Features

Use these custom formulas as parts in further complex calculations.

[Feature]
"F Bugs Count": Bugs.Where(UserStory.Feature == null || Feature.Id != UserStory.Feature.Id).Count
"F Bugs Effort": Bugs.Where(UserStory.Feature == null || Feature.Id != UserStory.Feature.Id).SUM(Effort)
"F Bugs Time Spent": Bugs.Where(UserStory.Feature == null || Feature.Id != UserStory.Feature.Id).SUM(TimeSpent)
"F Bugs Cost": Bugs.Where(UserStory.Feature == null || Feature.Id != UserStory.Feature.Id).SUM(CustomValues.Number("Cost"))

4. Metrics for totals in Features

Prerequisites:

  • Add corresponding numeric system custom fields on Feature level in advance.

Set up these custom calculations as custom formula metrics for numeric system custom fields on Feature level.

Custom FieldCustom Field TypeCustom Formula Metric
Bugs CountNumber, SystemUserStories.SUM(CustomValues.Number("Bugs Count")) + Bugs.Where(UserStory.Feature == null || Feature.Id != UserStory.Feature.Id).Count
Bugs EffortNumber, SystemUserStories.SUM(CustomValues.Number("Bugs Effort")) + Bugs.Where(UserStory.Feature == null || Feature.Id != UserStory.Feature.Id).SUM(Effort)
Bugs Time SpentNumber, SystemUserStories.SUM(CustomValues.Number("Bugs Time Spent")) + Bugs.Where(UserStory.Feature == null || Feature.Id != UserStory.Feature.Id).SUM(TimeSpent)
Bugs CostNumber, SystemUserStories.SUM(CustomValues.Number("Bugs Cost")) + Bugs.Where(UserStory.Feature == null || Feature.Id != UserStory.Feature.Id).SUM(CustomValues.Number("Cost"))
Still have a question?

We're here to help! Just contact our friendly support team

Find out more about our APIs, Plugins, Mashups and custom extensions. Join our community of passionate users and even discuss directly with our developers.