如何防止工作项中的保存异常?

How to prevent Save Exception in Work Items?

版本 8.9.2 - 当我 运行 使用基本 Scrum 流程(使用将 ReflectedWorkItemId 添加到 WIT 的继承流程进行修改)从 Azure DevOps 迁移到 Azure DevOps 时,我观察到一小部分的保存异常work-items 迁移期间。迁移后,我发现创建的空 work-items 没有标题。示例:

(会话 ID:5c74594c-ad96-4d2c-a056-8aec8e35e9f8)

[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | 
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | Work Item has 10 revisions and revision migration is set to True
===============================================================================================
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | Found 10 revisions to migrate on  Work item:120
===============================================================================================
[                Task][Complete: 1/10][sid:120   |Rev:1  ][tid:null   |  Processing Revision [1]
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | ...FAILED to Save
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | Custom.ReflectedWorkItemId (ReflectedWorkItemId) | 
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | Microsoft.VSTS.Common.BacklogPriority (Backlog Priority) | 
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | Microsoft.VSTS.CMMI.Blocked (Blocked) | 
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | Microsoft.VSTS.Build.IntegrationBuild (Integration Build) | 
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | Microsoft.VSTS.Common.Priority (Priority) | 2
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | Microsoft.VSTS.Common.ClosedBy (Closed By) | 
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | Microsoft.VSTS.Common.ClosedDate (Closed Date) | 
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | Microsoft.VSTS.Common.ActivatedBy (Activated By) | 
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | Microsoft.VSTS.Common.ActivatedDate (Activated Date) | 
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | Microsoft.VSTS.Common.StateChangeDate (State Change Date) | 
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | Microsoft.VSTS.Common.Activity (Activity) | 
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | Microsoft.VSTS.Scheduling.RemainingWork (Remaining Work) | 
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.BoardLane (Board Lane) | 
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.BoardColumnDone (Board Column Done) | 
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.BoardColumn (Board Column) | 
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.Tags (Tags) | 
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.RelatedLinkCount (Related Link Count) | 0
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.History (History) | 
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.Description (Description) | 
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.CreatedBy (Created By) | Lori Y
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.CreatedDate (Created Date) | 1/9/2019 8:40:17 AM
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.WorkItemType (Work Item Type) | Task
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.AssignedTo (Assigned To) | 
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.Reason (Reason) | New task
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.ChangedBy (Changed By) | Taylor, Simon Z
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.Rev (Rev) | 
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.Watermark (Watermark) | 
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.AuthorizedDate (Authorized Date) | 
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.State (State) | To Do
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.Title (Title) | 
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.AuthorizedAs (Authorized As) | 
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.AreaId (Area ID) | 23
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.Id (ID) | 0
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.ChangedDate (Changed Date) | 
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.RevisedDate (Revised Date) | 
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.AreaPath (Area Path) | Oit migration test
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.NodeName (Node Name) | Oit migration test
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.AttachedFileCount (Attached File Count) | 0
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.HyperLinkCount (Hyperlink Count) | 0
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.CommentCount (Comment Count) | 
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.RemoteLinkCount (Remote Link Count) | 
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.Parent (Parent) | 
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.TeamProject (Team Project) | Oit migration test
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.ExternalLinkCount (External Link Count) | 0
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.IterationId (Iteration ID) | 23
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.IterationPath (Iteration Path) | Oit migration test
[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | System.AggregateException: One or more errors occurred. ---> Microsoft.VisualStudio.Services.WebApi.VssServiceResponseException: Page not found.
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<HandleResponseAsync>d__53.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__51.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__47`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__28`1.MoveNext()
   --- End of inner exception stack trace ---
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
   at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
   at System.Threading.Tasks.Task.Wait()
   at VstsSyncMigrator.Engine.WorkItemMigrationContext.ReplayRevisions(List`1 revisionsToMigrate, WorkItem sourceWorkItem, WorkItem targetWorkItem, Project destProject, WorkItemStoreContext sourceStore, Int32 current, WorkItemStoreContext targetStore) in D:\a\s\src\VstsSyncMigrator.Core\Execution\MigrationContext\WorkItemMigrationContext.cs:line 394
---> (Inner Exception #0) Microsoft.VisualStudio.Services.WebApi.VssServiceResponseException: Page not found.
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<HandleResponseAsync>d__53.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__51.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__47`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__28`1.MoveNext()<---

[Product Backlog Item][Complete: 1/10][sid:120   |Rev:10 ][tid:null   | Average time of 1:644 seconds per work item and 0 hours 0 minutes 16:440 seconds estimated to completion

我使用以下步骤重现了这个错误: 1. 设置 modified/inherited Scrum 流程 "Migration" 并将 "ReflectedWorkItemId" 添加到两个独立的 Azure DevOps 组织中的适当 WIT 2. 使用 (1) 中配置的迁移过程设置源和目标项目 "Migration test 2" 3. 在标题为 "Test Changing PBI to Task" 的源项目中创建并保存产品待办列表项 WIT 4. 将刚刚创建的 WIT 的类型更改为类型 Task。通过从 "New" 更改为 "To Do" 解决状态字段问题并保存 5. 设置 configuration.json 配置基于默认 ("init") 生成 json w/ 每个视频的典型修改(空场映射等)。启用迭代处理器和 WIT 处理器。修改 WIT 处理器的 QueryBit 以仅排除测试套件和测试计划 WIT。将 ReplayRevisions 设置为 true。 6. 运行 迁移(在 (2) 和 (3) 中创建和修改的 WIT 上)。重现错误:

(会话 ID:6984b357-03ec-401d-ba03-7d43c84c4c6e)

Found 'Custom.ReflectedWorkItemId' in this project, proceeding.
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | 
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | Work Item has 2 revisions and revision migration is set to True
===============================================================================================
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | Found 2 revisions to migrate on  Work item:150
===============================================================================================
[Product Backlog Item][Complete:1/1][sid:150   |Rev:1  ][tid:null   |  Processing Revision [1]
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | ...FAILED to Save
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | Custom.ReflectedWorkItemId (ReflectedWorkItemId) | 
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | Microsoft.VSTS.Common.BacklogPriority (Backlog Priority) | 
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | Microsoft.VSTS.Common.AcceptanceCriteria (Acceptance Criteria) | 
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | Microsoft.VSTS.Scheduling.Effort (Effort) | 
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | Microsoft.VSTS.Common.BusinessValue (Business Value) | 
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | Microsoft.VSTS.Build.IntegrationBuild (Integration Build) | 
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | Microsoft.VSTS.Common.ValueArea (Value Area) | Business
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | Microsoft.VSTS.Common.Priority (Priority) | 2
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | Microsoft.VSTS.Common.ClosedBy (Closed By) | 
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | Microsoft.VSTS.Common.ClosedDate (Closed Date) | 
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | Microsoft.VSTS.Common.ActivatedBy (Activated By) | 
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | Microsoft.VSTS.Common.ActivatedDate (Activated Date) | 
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | Microsoft.VSTS.Common.StateChangeDate (State Change Date) | 
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.BoardLane (Board Lane) | 
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.BoardColumnDone (Board Column Done) | 
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.BoardColumn (Board Column) | 
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.Tags (Tags) | 
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.RelatedLinkCount (Related Link Count) | 0
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.History (History) | 
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.Description (Description) | 
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.CreatedBy (Created By) | Taylor, Simon Z
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.CreatedDate (Created Date) | 5/11/2020 2:07:59 PM
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.WorkItemType (Work Item Type) | Product Backlog Item
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.AssignedTo (Assigned To) | 
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.Reason (Reason) | New backlog item
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.ChangedBy (Changed By) | Taylor, Simon Z
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.Rev (Rev) | 
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.Watermark (Watermark) | 
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.AuthorizedDate (Authorized Date) | 
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.State (State) | New
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.Title (Title) | 
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.AuthorizedAs (Authorized As) | 
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.AreaId (Area ID) | 40
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.Id (ID) | 0
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.ChangedDate (Changed Date) | 
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.RevisedDate (Revised Date) | 
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.AreaPath (Area Path) | Oit migration test 2
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.NodeName (Node Name) | Oit migration test 2
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.AttachedFileCount (Attached File Count) | 0
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.HyperLinkCount (Hyperlink Count) | 0
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.CommentCount (Comment Count) | 
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.RemoteLinkCount (Remote Link Count) | 
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.Parent (Parent) | 
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.TeamProject (Team Project) | Oit migration test 2
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.ExternalLinkCount (External Link Count) | 0
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.IterationId (Iteration ID) | 40
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.IterationPath (Iteration Path) | Oit migration test 2
[                Task][Complete:1/1][sid:150   |Rev:2  ][tid:null   | System.AggregateException: One or more errors occurred. ---> Microsoft.VisualStudio.Services.WebApi.VssServiceResponseException: Page not found.
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<HandleResponseAsync>d__53.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__51.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__47`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)

迁移自:https://github.com/nkdAgility/azure-devops-migration-tools/issues/485

查看文档后,我找到了 VstsSyncMigrator.Engine.Configuration.Processing.WorkItemMigrationConfig 处理器的 SkipToFinalRevisedWorkItemType 配置元素。文档有点神秘,但我尝试将此配置元素设置为 true 并发现它消除了保存异常,导致成功迁移并且没有 blank-titled work-items.

我搜索了所有问题,但没有找到提及 SkipToFinalRevisedWorkItemType 的信息,除了一个包含 configuration.json 列表的已关闭问题。

如果 SkipToFinalRevisedWorkItemType 的预期功能是解决此保存异常,我建议更新文档以指示 work-item 更改的类型在重播修订时将无法保存,除非 SkipToFinalRevisedWorkItemType 设置为 true .理想情况下,将添加导致更多 graceful/informative 异常处理的代码更新,如果不能在重播修订时成功导航 work-item 类型更改的功能。

如果这些选项中的 none 目前是可能的,那么这个问题可以关闭作为名义文档。