microsoft / vsts-work-item-migrator

WiMigrator is a command line tool for migrating work items between VSTS/TFS projects
MIT License
148 stars 69 forks source link

Unable to migrate in Azure DevOps Server 2019: VS403417 #66

Open tbergstedt opened 5 years ago

tbergstedt commented 5 years ago

We are testing migration in Azure DevOps Server 2019 and are having trouble making it work. For every workitem, we receive the error VS403417: ChangedBy value cannot be empty when BypassRules is specified

When debugging, it seems to us that Microsoft has changed returning "identity fields" from a string {first name} {last name} <{user-id}> to a complete Microsoft.VisualStudio.Services.WebApi.IdentityRef. When we "hack" in Common\Migration\Phase1\WitBatchRequestGenerators\BaseWitBatchRequestGenerator.cs to instead return the old type of value using the code below, it works again:

if(sourceField.Value.GetType() == typeof(Microsoft.VisualStudio.Services.WebApi.IdentityRef)){
  var identity = (Microsoft.VisualStudio.Services.WebApi.IdentityRef)sourceField.Value;
  string updatedIdentityFieldValue = identity.DisplayName + " <" + identity.UniqueName + ">";
  KeyValuePair<string, object> updatedField = new KeyValuePair<string, object>
}

We know this not a viable solution to the problem. But we wanted to notify you that there might be a general problem using this tool in Azure DevOps Server 2019, and we feel we are not proficient enough in you tool to make the correct changes ourselves.

(Btw, we are still using TFS 2018 in our production environment, so the migration works fine there without using this "hack").

obvioussean commented 5 years ago

Thank you for reporting this. I'll investigate, since the API version we're using should not be returning IdentityRef.

obvioussean commented 5 years ago

@tbergstedt I'm unable to reproduce this. Have you made any other changes to the migrator? By using the m131 package it should not have any issues with returning an IdentityRef. And for sure you're migrating between two TFS 2019 servers?

dingzhanjun commented 5 years ago

I am on 2019 and having the same issue too,

jackpoz commented 3 years ago

This issue happened to me today too using another software but with the exact same error. While troubleshooting I changed WorkItemStoreFlags from BypassRules to None and received a different error about the work item type being disabled. I checked in the process, re-enabled it and that fixed the "ChangedBy value cannot be empty when BypassRules is specified" issue.

Hope this will help people reaching this github issue when googling 😃