Let me provide the complete implementation details covering all the technical components.
1. OData Analytics Views Configuration
First, create custom Analytics views in Azure DevOps (Analytics > Views > New View):
Requirements-Test Traceability View:
- Entities: WorkItems, WorkItemLinks
- Work Item Types: Requirement, Test Case
- Link Types: Tests, Tested By
- Fields: ID, Title, State, Area Path, Tags, Custom.RegulatoryCategory, Custom.RiskLevel
- Filter: State != Removed
- History: Last 90 days (for trend analysis)
The OData endpoint URL format:
https://analytics.dev.azure.com/{org}/{project}/_odata/v4.0-preview/WorkItemLinks?
$filter=LinkTypeName eq 'Tests'
&$expand=SourceWorkItem,TargetWorkItem
Test Execution Results View:
- Entities: TestRuns, TestResults
- Fields: TestRunId, TestCaseId, Outcome, CompletedDate, Configuration
- Filter: CompletedDate >= @StartOfMonth
- Aggregations: Count of Passed/Failed/Blocked tests
2. Power Automate Flows
We implemented three flows:
Daily Coverage Monitoring Flow:
- Trigger: Recurrence (daily at 6 AM)
- Action 1: HTTP request to Analytics API to get requirement counts by area path
- Action 2: HTTP request to get linked test case counts
- Action 3: Calculate coverage percentage (LinkedTests / TotalRequirements * 100)
- Action 4: Condition - if coverage < 85%
- Action 5: Create Azure DevOps work item (Bug type with custom tag ‘TraceabilityGap’)
- Action 6: Send email notification with coverage details
The flow uses a service principal with Analytics Reader permissions for API authentication.
Real-time Link Validation Flow:
- Trigger: When a work item is created or modified (webhook)
- Action 1: Check if work item is type ‘Requirement’
- Action 2: Query Analytics for linked test cases
- Action 3: If no links exist and requirement is in ‘Active’ state, add warning comment to work item
3. Power BI DirectQuery Setup
Connect Power BI Desktop to Azure DevOps Analytics:
- Data Source: OData feed
- URL: Your custom Analytics view OData endpoint
- Authentication: Organizational account (Azure AD)
- Connection Mode: DirectQuery (for real-time data)
Data Model:
- Fact Table: WorkItemLinks (traceability relationships)
- Dimension Tables: Requirements, TestCases, TestRuns, AreaPaths
- Relationships: WorkItemLinks.SourceWorkItemId → Requirements.WorkItemId
- Calculated Measures:
- Coverage % = DIVIDE(COUNT(LinkedTestCases), COUNT(Requirements), 0)
- Untested Requirements = CALCULATE(COUNT(Requirements), FILTER(Requirements, NOT(Requirements[WorkItemId] IN VALUES(WorkItemLinks[SourceWorkItemId]))))
4. Row Level Security Implementation
Create RLS roles in Power BI Desktop:
- Role: ComponentTeamA
- Filter: AreaPaths[AreaPath] = “Project\ComponentA”
- Applied to: Requirements, TestCases, WorkItemLinks tables
Map Azure AD users to roles using Power BI Service:
- Workspace Settings > Security
- Add user emails or security groups to appropriate roles
- Users only see data matching their area path filters
For dynamic RLS based on Azure DevOps team membership:
- Create a separate Azure Function that queries Azure DevOps API for team members
- Store mapping in Azure SQL Database
- Import mapping table into Power BI as a dimension
- RLS filter: UserMapping[UserEmail] = USERPRINCIPALNAME()
5. Coverage Alerts Configuration
Power Automate alert flow logic:
// Pseudocode for coverage calculation:
1. Query Analytics API: GET WorkItems filtered by Type='Requirement' AND State='Active'
2. Store count as totalRequirements
3. Query Analytics API: GET WorkItemLinks filtered by LinkType='Tests'
4. Count distinct SourceWorkItemIds as linkedRequirements
5. Calculate: coveragePercent = (linkedRequirements / totalRequirements) * 100
6. If coveragePercent < 85:
- Create work item with title "Traceability Gap: {componentName} coverage at {coveragePercent}%"
- Set priority based on gap severity (>20% gap = Priority 1)
- Assign to area path owner (query Teams API)
- Add tags: TraceabilityGap, ComplianceRisk
Alert emails include:
- Current coverage percentage
- List of untested requirements (IDs and titles)
- Link to Power BI dashboard filtered to the affected component
- Trend chart showing coverage over last 30 days
Implementation Timeline & Lessons Learned:
- Week 1-2: Analytics views setup and OData query optimization
- Week 3: Power BI report development and testing
- Week 4: Power Automate flows and alert logic
- Week 5: RLS configuration and user testing
- Week 6: Training and rollout
Key lessons:
- Start with read-only Analytics access to avoid query performance issues
- Use incremental refresh in Power BI for historical test run data (reduces load times)
- Document the OData queries thoroughly - the syntax is not intuitive
- Test RLS extensively before production rollout - security bugs are critical in compliance scenarios
- Create a “Traceability Admin” role with full access for troubleshooting
The system now runs automatically with minimal maintenance. We review the dashboards weekly and adjust alert thresholds quarterly based on team feedback. The 75% time savings freed up our QA manager to focus on test strategy and process improvements rather than manual data compilation.