Skip to content

Commit a49e46d

Browse files
committed
Add TfsWorkItemTypeValidatorTool configuration and documentation
1 parent 1907129 commit a49e46d

File tree

2 files changed

+104
-0
lines changed

2 files changed

+104
-0
lines changed

appsettings.json

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,9 @@
178178
"Enabled": true,
179179
"Mappings": {
180180
}
181+
},
182+
"TfsWorkItemTypeValidatorTool": {
183+
"Enabled": true
181184
}
182185
},
183186
"CommonToolSamples": {
@@ -187,6 +190,23 @@
187190
"RepoInSource": "RepoInTarget"
188191
}
189192
},
193+
"TfsWorkItemTypeValidatorTool": {
194+
"Enabled": true,
195+
"IncludeWorkItemtypes": [
196+
"Bug",
197+
"Task",
198+
"User Story",
199+
"Product Backlog Item",
200+
"Feature",
201+
"Epic",
202+
"Risk"
203+
],
204+
"FieldMappings": {
205+
"User Story": {
206+
"Microsoft.VSTS.Common.Prirucka": "Custom.Prirucka"
207+
}
208+
}
209+
},
190210
"TfsValidateRequiredFieldTool": {
191211
"Enabled": true,
192212
"Exclusions": [ "Work Request", "Opertunity", "Assumption" ]

docs/content/docs/reference/tools/tfs-workitemtype-validator-tool/index.md

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,35 @@ discussionId: 2903
2020

2121
{{< class-options >}}
2222

23+
## How it Works
24+
25+
TfsWorkItemTypeValidatorTool validates work item types and fields between the source and target systems before migration starts. Its purpose is to catch missing types or fields early and stop the migration if the configuration is invalid. Validation now runs at the very beginning of migration, so issues are detected quickly.
26+
27+
* **Enabled by default**: The tool runs even without configuration. It can be disabled explicitly, in which case a warning will be logged.
28+
* **Validation respects mappings**: Work item type mappings (`IWorkItemTypeMappingTool`) are applied before validation.
29+
* **Validation checks**:
30+
* Existence of work item types in the target system.
31+
* Existence of the reflected work item ID field.
32+
* Existence of source fields in the corresponding target work item type.
33+
* **Failure behaviour**: If validation fails, migration is stopped immediately.
34+
* **Scope control**:
35+
* Users can configure which work item types to validate. If none are specified, all are validated.
36+
* Users can configure field mappings per work item type to:
37+
38+
* Map a source field to a different target field.
39+
* Exclude a field from validation (by mapping it to an empty string).
40+
2341
## Samples
2442

2543
### Sample
2644

2745
{{< class-sample sample="sample" >}}
2846

47+
48+
* **Enabled**: Controls whether the tool runs (default is `true`).
49+
* **IncludeWorkItemtypes**: Limits validation to specific work item types.
50+
* **FieldMappings**: Defines per-type field mappings or exclusions.
51+
2952
### Defaults
3053

3154
{{< class-sample sample="defaults" >}}
@@ -41,3 +64,64 @@ discussionId: 2903
4164
## Schema
4265

4366
{{< class-schema >}}
67+
68+
69+
## Log output example
70+
71+
```
72+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Validating work item types.
73+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Source work item types are: Bug, Task, Quality of Service Requirement, User Story, Risk, Test Plan, Test Suite, Code Review Request, Code Review Response, Epic, Feature, Feedback Request, Feedback Response, Impediment, Product Backlog Item, Shared Parameter, Shared Steps, Test Case.
74+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Target work item types are: Bug, Code Review Request, Code Review Response, Epic, Feature, Feedback Request, Feedback Response, Shared Steps, Task, Test Case, Test Plan, Test Suite, User Story, Issue, Shared Parameter.
75+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Validating work item type 'Feature'
76+
[10:54:09 WRN] [16.2.10-Local.8-1-gfcb86e55] 'Feature' does not contain reflected work item ID field 'Custom.TfsWorkItemId'.
77+
[10:54:09 WRN] [16.2.10-Local.8-1-gfcb86e55] Missing field 'Microsoft.VSTS.Common.AcceptanceCriteria' in 'Feature'.
78+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Source field name: Microsoft.VSTS.Common.AcceptanceCriteria
79+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Field type: Html
80+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Allowed values:
81+
[10:54:09 WRN] [16.2.10-Local.8-1-gfcb86e55] Missing field 'Microsoft.VSTS.Common.BacklogPriority' in 'Feature'.
82+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Source field name: Microsoft.VSTS.Common.BacklogPriority
83+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Field type: Double
84+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Allowed values:
85+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Validating work item type 'Risk'
86+
[10:54:09 WRN] [16.2.10-Local.8-1-gfcb86e55] Work item type 'Risk' does not exist in target system.
87+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Skipping validation of work item type 'Test Plan' because it is not included in validation list.
88+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Skipping validation of work item type 'Test Suite' because it is not included in validation list.
89+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Validating work item type 'Product Backlog Item'
90+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] This work item type is mapped to 'User Story' in target.
91+
[10:54:09 WRN] [16.2.10-Local.8-1-gfcb86e55] 'User Story' does not contain reflected work item ID field 'Custom.TfsWorkItemId'.
92+
[10:54:09 WRN] [16.2.10-Local.8-1-gfcb86e55] Missing field 'Microsoft.VSTS.Common.Novika' in 'User Story'.
93+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Source field name: Microsoft.VSTS.Common.Novika
94+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Field type: Boolean
95+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Allowed values:
96+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Source field 'Microsoft.VSTS.Common.Prirucka' is mapped as empty string, so it is not validated in target.
97+
[10:54:09 WRN] [16.2.10-Local.8-1-gfcb86e55] Missing field 'Microsoft.VSTS.Common.StavHelpu' in 'User Story'.
98+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Source field name: Microsoft.VSTS.Common.StavHelpu
99+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Field type: String
100+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Allowed values: '0-Nezačaté', '1-Rozrobené', '2-Dokončené'
101+
[10:54:09 WRN] [16.2.10-Local.8-1-gfcb86e55] Missing field 'Microsoft.VSTS.Common.Help' in 'User Story'.
102+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Source field name: Microsoft.VSTS.Common.Help
103+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Field type: Boolean
104+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Allowed values:
105+
[10:54:09 WRN] [16.2.10-Local.8-1-gfcb86e55] Missing field 'Microsoft.VSTS.Common.SuperUserStory' in 'User Story'.
106+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Source field name: Microsoft.VSTS.Common.SuperUserStory
107+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Field type: String
108+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Allowed values:
109+
[10:54:09 WRN] [16.2.10-Local.8-1-gfcb86e55] Missing field 'Microsoft.VSTS.Common.Planovac' in 'User Story'.
110+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Source field name: Microsoft.VSTS.Common.Planovac
111+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Field type: String
112+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Allowed values:
113+
[10:54:09 WRN] [16.2.10-Local.8-1-gfcb86e55] Missing field 'Microsoft.VSTS.Common.BusinessValue' in 'User Story'.
114+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Source field name: Microsoft.VSTS.Common.BusinessValue
115+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Field type: Integer
116+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Allowed values:
117+
[10:54:09 WRN] [16.2.10-Local.8-1-gfcb86e55] Missing field 'Microsoft.VSTS.Scheduling.Effort' in 'User Story'.
118+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Source field name: Microsoft.VSTS.Scheduling.Effort
119+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Field type: Double
120+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Allowed values:
121+
[10:54:09 WRN] [16.2.10-Local.8-1-gfcb86e55] Missing field 'Microsoft.VSTS.Common.BacklogPriority' in 'User Story'.
122+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Source field name: Microsoft.VSTS.Common.BacklogPriority
123+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Field type: Double
124+
[10:54:09 INF] [16.2.10-Local.8-1-gfcb86e55] Allowed values:
125+
[10:54:09 ERR] [16.2.10-Local.8-1-gfcb86e55] Some work item types or their fields are not present in the target system (see previous logs). Either add these fields into target work items, or map source fields to other target fields in options (FieldMappings).
126+
```
127+

0 commit comments

Comments
 (0)