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



版本 8.9.2 - 当我使用基本 Scrum 进程(使用将 ReflectedWorkItemId 添加到 WIT 的继承进程进行修改(运行 Azure DevOps 到 Azure DevOps 迁移时,我观察到在迁移过程中保存一小部分工作项的异常。 迁移后,我发现创建的空工作项没有标题。 例:

(会话 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:a1ssrcVstsSyncMigrator.CoreExecutionMigrationContextWorkItemMigrationContext.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. 设置修改/继承的 Scrum 流程"迁移",并将"ReflectedWorkItemId"添加到两个独立的 Azure DevOps 组织的相应 WIT 中 2. 使用(1(中配置的迁移过程设置源和目标项目"迁移测试2" 3. 在标题为"测试将 PBI 更改为任务"的源项目中创建并保存产品积压工作项 WIT。 4. 将刚创建的 WIT 类型更改为"任务"。 通过从"新建"更改为"待办事项"来解决状态字段问题并保存 5. 设置配置.json 配置基于默认("init"(生成的 json 与每个视频的典型修改(空字段映射等(。 启用迭代处理器和 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,发现它消除了保存异常,导致成功迁移并且没有空白标题的工作项。

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

如果 SkipToFinalRevisedWorkItemType的预期功能是解决此 Save 异常,我建议进行文档更新,以指示在重播修订时更改的工作项类型将无法保存,除非 SkipToFinalRevisedWorkItemType 设置为 true。理想情况下,将添加导致更优雅/信息更丰富的异常处理的代码更新,如果不是可以在重播修订时成功导航工作项类型更改的功能。

如果目前这些选项都不可能,则可以关闭此问题以用作名义文档。

最新更新