Commit 4b1a701
authored
Log a warning if the Microsoft.VSTS.TCM.Steps field does not exist on the source work item. (#2721)
**FEATURE SUGGESTION**
This PR adds a try-catch block around the line of code that tries to
access the `Microsoft.VSTS.TCM.Steps` field, whcih can fail if the Steps
field does not exist on the source work item.
This change has enabled us to map non-Test Case Work Item types to Test
Cases, which was previously not possible.
I am submitting this PR in order to raise awareness of the issue. It
seems like there are several unchecked attempts to access fields in the
`oldWorkItemData` based on the available fields of `newWorkItemData`,
without considering if those fields are present on the source work item
or not.
The same thing happens for `Microsoft.VSTS.Common.Priority` here, and I
can imagine that this will cause the same error if the source Work Item
Types does not have the Priority field:
https://github.com/nkdAgility/azure-devops-migration-tools/blob/498f1824b62bd04915116a9a76149765393e4377/src/MigrationTools.Clients.TfsObjectModel/Processors/TfsWorkItemMigrationProcessor.cs#L537-L538
Previously, the migrator would throw an exception which casued the whole
revision import to fail, resulting in other missing fields, links,
attachments, etc.
The relevant error message was:
```txt
Microsoft.TeamFoundation.WorkItemTracking.Client.FieldDefinitionNotExistException: TF26027: A field definition
Microsoft.VSTS.TCM.Steps in the work item type definition file does not exist. Add a definition for this field
or remove the reference to the field and try again.
```
Let me know if you have further suggestions.File tree
1 file changed
+8
-1
lines changed- src/MigrationTools.Clients.TfsObjectModel/Processors
1 file changed
+8
-1
lines changedLines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
533 | 533 | | |
534 | 534 | | |
535 | 535 | | |
536 | | - | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
537 | 544 | | |
538 | 545 | | |
539 | 546 | | |
| |||
0 commit comments