vsts-work-item-migrator icon indicating copy to clipboard operation
vsts-work-item-migrator copied to clipboard

Unable to migrate in Azure DevOps Server 2019: VS403417

Open tbergstedt opened this issue 5 years ago • 4 comments

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").

tbergstedt avatar Jun 20 '19 07:06 tbergstedt

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

obvioussean avatar Sep 12 '19 14:09 obvioussean

@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?

obvioussean avatar Sep 12 '19 19:09 obvioussean

I am on 2019 and having the same issue too,

dingzhanjun avatar Sep 19 '19 19:09 dingzhanjun

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 😃

jackpoz avatar Oct 01 '20 19:10 jackpoz