Hi ,
Thanks for reaching out to Microsoft Q&A.
To calculate the progress of an epic based on the hours worked on its child stories and tasks in Azure DevOps, you can follow these steps:
Setup Your Work Items
Ensure your epic, child stories, and tasks have the following fields properly configured:
- Original Estimate: Total estimated hours for the task/story.
- Remaining Work: Remaining hours to complete the task/story.
- Completed Work: Hours already spent on the task/story.
Use Azure DevOps Queries
- Create a query to pull all child stories and tasks under a specific epic.
- Include the
Original Estimate
,Remaining Work
, andCompleted Work
fields in the query.
Calculate Progress
- Formula for Progress: Progress= (totalcompleted work/total original estimate)x100
- Use the following aggregate calculations:
- Total Original Estimate: Sum of the
Original Estimate
field for all child stories and tasks. - Total Completed Work: Sum of the
Completed Work
field for all child stories and tasks.
- Total Original Estimate: Sum of the
Automate Progress Calculation
Azure DevOps doesn't natively calculate progress based on hours, so you have two options for automation:
Use Azure DevOps Analytics Views
- Enable Analytics in your Azure DevOps project.
- Use Power BI to connect to the Analytics Service.
- Create a report that calculates epic progress based on the hours worked.
Write a Custom Script Using Azure DevOps API
- Use the Azure DevOps REST API to retrieve work item data programmatically.
- Use the following API endpoints:
-
Get Work Item
to fetch the epic and its child stories/tasks.- Aggregate the
Original Estimate
,Remaining Work
, andCompleted Work
fields. - Calculate the progress percentage using the formula above.
- Aggregate the
-
Update Epic with Progress
- Use the REST API to update the epic's custom field (if created) or a predefined field with the calculated progress.
- Use Dashboards in azure devops to display progress using widgets like "Progress by Query" or custom Power BI visuals.
Please feel free to click the 'Upvote' (Thumbs-up) button and 'Accept as Answer'. This helps the community by allowing others with similar queries to easily find the solution.