Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DevOps to DevOps - System.ArgumentNullException: Value cannot be null #235

Closed
middiu opened this issue Apr 16, 2019 · 3 comments
Closed

Comments

@middiu
Copy link

middiu commented Apr 16, 2019

Hi All,

I'm facing the following issue migrating my workitems across two different DevOps Organizations.
I don't need to modify my workitems during the migration, I just need to copy them AS IS.

This is the config file I'm using:

{
    "TelemetryEnableTrace": false,
    "workaroundForQuerySOAPBugEnabled": false,
    "Source": {
        "Collection": "https://dev.azure.com/XYZ/",
        "Name": "ABC"
    },
    "Target": {
        "Collection": "https://dev.azure.com/XYZ/",
        "Name": "ABC"
    },
    "WorkItemTypeDefinition": {
        "Bug": "Bug",
        "Epic": "Epic",
        "Feature": "Feature",
        "Issue": "Issue",
        "Task": "Task",
        "Test Case": "Test Case",
        "Test Plan":"Test Plan",
        "Test Suite":"Test Suite",
        "User Story": "User Story"
        },
    "Processors": [ {
            "ObjectType": "VstsSyncMigrator.Engine.Configuration.Processing.WorkItemRevisionReplayMigrationConfig",
            "Enabled": true,
            "PrefixProjectToNodes": false,
            "UpdateSoureReflectedId": false,
            "QueryBit": "AND [System.WorkItemType] IN ('Issue', 'Feature', 'Test Case', 'Requirement', 'Task', 'User Story', 'Bug')",
            }]
}

and this is the output:

migration.exe Information: 0 :  Access granted 
WorkItemRevisionReplayMigrationContext: Found target project as ABC
migration.exe Warning: 0 :   [EXCEPTION] System.ArgumentNullException: Value cannot be null.
Parameter name: name
   at Microsoft.TeamFoundation.WorkItemTracking.Client.FieldDefinitionCollection.Contains(String name)
   at Microsoft.TeamFoundation.WorkItemTracking.Client.FieldCollection.Contains(String fieldName)
   at VstsSyncMigrator.Engine.WorkItemStoreContext.FindReflectedWorkItem(WorkItem workItemToFind, String reflectedWotkItemIdField, Boolean cache) in D:\a\1\s\src\VstsSyncMigrator.Core\Execution\ComponentContext\WorkItemStoreContext.cs:line 105
   at VstsSyncMigrator.Engine.WorkItemRevisionReplayMigrationContext.InternalExecute() in D:\a\1\s\src\VstsSyncMigrator.Core\Execution\MigrationContext\WorkItemRevisionReplayMigrationContext.cs:line 91
   at VstsSyncMigrator.Engine.MigrationContextBase.Execute() in D:\a\1\s\src\VstsSyncMigrator.Core\Execution\MigrationContext\MigrationContextBase.cs:line 35
MigrationEngine: The Processor WorkItemRevisionReplayMigrationContext entered the failed state...stopping run
[Info]: Run complete...
[Info]: -------------------------------END------------------------------
[Info]: Duration: 00:00:02.9628098
[Info]: End Time: 16/04/2019 8:38:16 PM

Any help would be really appreciated.

Regards

@MrHinsh
Copy link
Member

MrHinsh commented Apr 23, 2019

Are you copying them within the same Project? That has never been tested.

I would recommned running in Debug within Visual Studio and checking out what is going wrong.

@inikalaichanka
Copy link

inikalaichanka commented Jun 17, 2019

hi, I had the same issue, and the following solution helped:

  1. you should define "ReflectedWorkItemIDFieldName" property in configuration.json file.
    E.g. "ReflectedWorkItemIDFieldName": "Source Item URL"
  2. The property value should be either a real custom field in the target project or just any existing field with type of 'string' (as workaround - not sure about correctness).

ReflectedWorkItemIDFieldName is used as a field to write "http(s)://dev.azure.com/{source-company-name}/{source-project-name}/_workitems/edit/{source-item-id}" value. Please see method string CreateReflectedWorkItemId(WorkItem wi) for more details here https://github.com/nkdAgility/azure-devops-migration-tools/blob/master/src/VstsSyncMigrator.Core/Execution/ComponentContext/WorkItemStoreContext.cs

@github-actions
Copy link

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 10 days

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants