Your traceability breakdown is a common issue when teams rely solely on commit message references without establishing formal work item relationships. Here’s the comprehensive solution addressing all four critical areas:
1. Change Request to Requirement Linking:
Establish a mandatory parent-child relationship. Configure your process template:
- Organization Settings > Process > [Your process] > Change Request
- Add a custom rule: “When State = New, make Related Links required”
- Add field rule: “Parent link must be of type Requirement, Epic, or Feature”
For existing CRs without parents, run this query to find orphaned change requests:
SELECT [ID], [Title], [State]
FROM WorkItems
WHERE [Work Item Type] = 'Change Request'
AND [Parent] IS NULL
Manually review each result and establish the parent relationship based on git history and commit context.
2. Bidirectional Work Item Relationships:
Commit messages create one-way links. You need formal work item relationships:
- Bug → “Related” link → Change Request (the CR that introduced the defect)
- Change Request → “Parent” link → Requirement (the original requirement)
- Change Request → “Child” link → Task (implementation tasks)
- Commit → Auto-linked via message pattern to both CR and Task
Configure these relationship types in your process template under Work Item Types > Links. Enable “Enforce link types” to prevent incorrect relationship configurations.
3. Commit Message Requirement References:
Your current pattern is good but incomplete. Enhance commit message standards:
Fixes CR#12345, Related to REQ#6789
Update validation logic per requirement specification
- Added null check for user input
- Enhanced error message formatting
This creates links to both the CR and parent requirement. Train developers to include both references.
4. Audit Trail Configuration:
Enable comprehensive audit logging:
- Organization Settings > Policies > Change tracking
- Enable “Track work item changes”
- Enable “Track link changes”
- Set retention to match compliance requirements (typically 7 years for regulated industries)
Create a traceability validation query that runs weekly:
SELECT [ID], [Title], [Work Item Type], [Parent]
FROM WorkItemLinks
WHERE [Source].[Work Item Type] IN ('Bug', 'Change Request')
AND [Target].[Work Item Type] = 'Requirement'
AND [Link Type] = 'Parent'
This identifies work items that should have parent requirements but don’t.
Fixing Your Specific Case:
For Bug #45678 and CR#12345:
-
Review git history for commit abc123de:
- Identify which requirement originally requested that validation logic
- Check sprint planning records or product backlog history
-
Manually establish relationships:
- Open CR#12345
- Add link: “Parent” → Requirement #[identified from step 1]
- Open Bug #45678
- Add link: “Related” → CR#12345 (marks this CR as the source of the defect)
-
Document the reconstruction process in Bug #45678 comments for audit purposes
Preventing Future Issues:
Implement a pull request policy that requires:
- Work item linking (at least one work item per PR)
- Commit message pattern validation (regex check for proper format)
- Approval from someone who verifies parent requirement link exists
For your compliance audit, export the full traceability matrix showing Requirement → CR → Commit → Build → Release → Bug relationships. Use Azure DevOps Analytics to generate this report with custom queries that validate relationship completeness across the entire chain.