nkdAgility/azure-devops-migration-tools

[Bug]: (FixHtmlAttachmentLinks = true) is not working.

Raviprakashbd opened this issue · 3 comments

Version

  • I confirm that I am using the latest version

Source Version

Azure DevOps Server 2019

Target Version

Azure DevOps Server 2019

Relevant configuration

Processors": [
    {
      "$type": "WorkItemMigrationConfig",
      "Enabled": true,
      "ReplayRevisions": true,
      "PrefixProjectToNodes": false,
      "UpdateCreatedDate": true,
      "UpdateCreatedBy": true,
      //"WIQLQueryBit": "AND [System.WorkItemType] in ('Code Review Request','Code Review Response')",
      "WIQLQueryBit": "AND [System.ID] in (123)",
      "WIQLOrderBit": "[System.ChangedDate] desc",
      "LinkMigration": true,
      "AttachmentMigration": true,
      "AttachmentWorkingPath": "c:\\temp\\WorkItemAttachmentWorkingFolder\\",
      "FixHtmlAttachmentLinks": true,
      "SkipToFinalRevisedWorkItemType": true,
      "WorkItemCreateRetryLimit": 5,
      "FilterWorkItemsThatAlreadyExistInTarget": true,
      "PauseAfterEachWorkItem": false,
      "AttachmentMaxSize": 480000000,
      "AttachRevisionHistory": false,
      "LinkMigrationSaveEachAsAdded": true,
      "GenerateMigrationComment": true,
      "WorkItemIDs": null,
      "MaxRevisions": 0,
      "NodeStructureEnricherEnabled": true,
      "UseCommonNodeStructureEnricherConfig": false,
}
]

Relevant log output

[00:14:42 ERR] EmbededImagesRepairEnricher: Unable to fix HTML field attachments for work item 0 from https://dev.azure.com/Org1/ to https://dev.azure.com/Org2/
Microsoft.TeamFoundation.WorkItemTracking.WebApi.RuleValidationException: TF401320: Rule Error for field Found In. Error code: Required, InvalidEmpty. 3 additional errors occurred during validation of the work item. Please correct all errors and try again.
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<HandleResponseAsync>d__53.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   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.ExceptionServices.ExceptionDispatchInfo.Throw()
   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.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at Microsoft.VisualStudio.Services.WebApi.VssHttpClientBase.<SendAsync>d__28`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at MigrationTools.Enrichers.TfsEmbededImagesEnricher.UploadImageToTarget(WorkItem wi, String filePath) in C:\Users\tools\source\repos\azure-devops-migration-tools-master\src\MigrationTools.Clients.AzureDevops.ObjectModel\Enrichers\TfsEmbededImagesEnricher.cs:line 208
   at MigrationTools.Enrichers.TfsEmbededImagesEnricher.UploadedAndRetrieveAttachmentLinkUrl(String matchedSourceUri, String sourceFieldName, WorkItemData targetWorkItem, String sourcePersonalAccessToken) in C:\Users\tools\source\repos\azure-devops-migration-tools-master\src\MigrationTools.Clients.AzureDevops.ObjectModel\Enrichers\TfsEmbededImagesEnricher.cs:line 163
   at MigrationTools.Enrichers.TfsEmbededImagesEnricher.FixEmbededImages(WorkItemData wi, String oldTfsurl, String newTfsurl, String sourcePersonalAccessToken) in C:\Users\tools\source\repos\azure-devops-migration-tools-master\src\MigrationTools.Clients.AzureDevops.ObjectModel\Enrichers\TfsEmbededImagesEnricher.cs:line 98

What happened?

After migration of work item from Org1 to Org2, field and discussion box attchments/images are redirecting to the Org1.
Also I have go through some discussion like - #694
and #1344 but did not get any success.
any idea how I can resolved this.

Note- I am using latest version of tool.

Debug in Visual Studio

  • Visual Studio Debug

Hi @Raviprakashbd,

I had similar issue with the same error message, you're getting now.

If you read the error message, you will find all the answers. It is saying "Rule Error for field Found In. Error code: Required, InvalidEmpty. "

During the investigation, I found, that it is trying to create new item of this type (can be ticket, bug etc) (required for migration), but is not succeed, due to an error.

In your case error related to field "Found In" - because the field is "Required", and current value, that is provided is empty ("InvalidEmpty").

It is empty, because the field can be a custom one for the work item type in the process, so, it can't be fulfilled automatically by the migration tool, but it requires to have any value (it is mandatory) to create dummy item.

So, you need to figure out for which work item type you are getting those messages and adjust this field to be Optional in the current Process for this current work item type.

Hope this helps.
Kind regards

Hi @Raviprakashbd,

I had similar issue with the same error message, you're getting now.

If you read the error message, you will find all the answers. It is saying "Rule Error for field Found In. Error code: Required, InvalidEmpty. "

During the investigation, I found, that it is trying to create new item of this type (can be ticket, bug etc) (required for migration), but is not succeed, due to an error.

In your case error related to field "Found In" - because the field is "Required", and current value, that is provided is empty ("InvalidEmpty").

It is empty, because the field can be a custom one for the work item type in the process, so, it can't be fulfilled automatically by the migration tool, but it requires to have any value (it is mandatory) to create dummy item.

So, you need to figure out for which work item type you are getting those messages and adjust this field to be Optional in the current Process for this current work item type.

Hope this helps. Kind regards

Hi @Zencehg,

Thank you for reply!

Currently I am migrating Bug work item, and as you told about field Found In, yes this is required field and in source work item it is also having value, so when we start the migration then its always passing some value. to confirm this I am migrating only those work item which are having value in field Found In.

Is there any other soultion which you can refer?

Thank you!

Hi @Raviprakashbd,
I had similar issue with the same error message, you're getting now.
If you read the error message, you will find all the answers. It is saying "Rule Error for field Found In. Error code: Required, InvalidEmpty. "
During the investigation, I found, that it is trying to create new item of this type (can be ticket, bug etc) (required for migration), but is not succeed, due to an error.
In your case error related to field "Found In" - because the field is "Required", and current value, that is provided is empty ("InvalidEmpty").
It is empty, because the field can be a custom one for the work item type in the process, so, it can't be fulfilled automatically by the migration tool, but it requires to have any value (it is mandatory) to create dummy item.
So, you need to figure out for which work item type you are getting those messages and adjust this field to be Optional in the current Process for this current work item type.
Hope this helps. Kind regards

Hi @Zencehg,

Thank you for reply!

Currently I am migrating Bug work item, and as you told about field Found In, yes this is required field and in source work item it is also having value, so when we start the migration then its always passing some value. to confirm this I am migrating only those work item which are having value in field Found In.

Is there any other soultion which you can refer?

Thank you!

Hi @Raviprakashbd ,

I think you didn't get it. It is not about the work item (in source/target) to have a value. During the attachment link fix, the migration tool is creating a new dummy item first and during creation of this dummy item - it is getting this error, because the tools can't know about your custom fields.

So, just make this field optional and try to migrate again. You can revert it back after you did the migration.