Tfs WorkItem Migration Processor

WorkItemMigrationConfig is the main processor used to Migrate Work Items, Links, and Attachments. Use WorkItemMigrationConfig to configure.

Last updated: July 28, 2025 | Edit this page | Discuss this page

WorkItemMigrationConfig is the main processor used to Migrate Work Items, Links, and Attachments. Use WorkItemMigrationConfig to configure.

top

Options

Parameter
Type
Description
Default Value
Parameter:
AttachRevisionHistory
Type:
Boolean
Description:
This will create a json file with the revision history and attach it to the work item. Best used with MaxRevisions or ReplayRevisions.
Default Value:
Not specified
Parameter:
Enabled
Type:
Boolean
Description:
If set to true then the processor will run. Set to false and the processor will not run.
Default Value:
missing XML code comments
Parameter:
Enrichers
Type:
List
Description:
List of Enrichers that can be used to add more features to this processor. Only works with Native Processors and not legacy Processors.
Default Value:
missing XML code comments
Parameter:
FilterWorkItemsThatAlreadyExistInTarget
Type:
Boolean
Description:
This loads all of the work items already saved to the Target and removes them from the Source work item list prior to commencing the run. While this may take some time in large data sets it reduces the time of the overall migration significantly if you need to restart.
Default Value:
true
Parameter:
FixHtmlAttachmentLinks
Type:
Boolean
Description:
beta If enabled this will fix any image attachments URL’s, work item mention URL’s or user mentions in the HTML fields as well as discussion comments. You must specify a PersonalAccessToken in the Source project for Azure DevOps; TFS should use integrated authentication.
Default Value:
true
Parameter:
GenerateMigrationComment
Type:
Boolean
Description:
If enabled, adds a comment recording the migration
Default Value:
true
Parameter:
MaxGracefulFailures
Type:
Int32
Description:
The maximum number of failures to tolerate before the migration fails. When set above zero, a work item migration error is logged but the migration will continue until the number of failed items reaches the configured value, after which the migration fails.
Default Value:
Not specified
Parameter:
PauseAfterEachWorkItem
Type:
Boolean
Description:
Pause after each work item is migrated
Default Value:
Not specified
Parameter:
RefName
Type:
String
Description:
Refname will be used in the future to allow for using named Options without the need to copy all of the options.
Default Value:
missing XML code comments
Parameter:
SkipRevisionWithInvalidAreaPath
Type:
Boolean
Description:
When set to true, this setting will skip a revision if the source area has not been migrated, has been deleted or is somehow invalid, etc.
Default Value:
missing XML code comments
Parameter:
SkipRevisionWithInvalidIterationPath
Type:
Boolean
Description:
This will skip a revision if the source iteration has not been migrated i.e. it was deleted
Default Value:
missing XML code comments
Parameter:
SourceName
Type:
String
Description:
This is the IEndpoint that will be used as the source of the Migration. Can be null for a write only processor.
Default Value:
missing XML code comments
Parameter:
TargetName
Type:
String
Description:
This is the IEndpoint that will be used as the Target of the Migration. Can be null for a read only processor.
Default Value:
missing XML code comments
Parameter:
UpdateCreatedBy
Type:
Boolean
Description:
If this is enabled the creation process on the target project will create the items with the original creation date. (Important: The item history is always pointed to the date of the migration, it’s change only the data column CreateDate, not the internal create date)
Default Value:
true
Parameter:
UpdateCreatedDate
Type:
Boolean
Description:
If this is enabled the creation process on the target project will create the items with the original creation date. (Important: The item history is always pointed to the date of the migration, it’s change only the data column CreateDate, not the internal create date)
Default Value:
true
Parameter:
WIQLQuery
Type:
String
Description:
A work item query based on WIQL to select only important work items. To migrate all leave this empty. See WIQL Query Bits
Default Value:
SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @TeamProject AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan','Shared Steps','Shared Parameter','Feedback Request') ORDER BY [System.ChangedDate] desc
Parameter:
WorkItemCreateRetryLimit
Type:
Int32
Description:
beta If set to a number greater than 0 work items that fail to save will retry after a number of seconds equal to the retry count. This allows for periodic network glitches not to end the process.
Default Value:
5
Parameter:
WorkItemIDs
Type:
IList
Description:
A list of work items to import
Default Value:
[]
top

Samples

top

Sample

Sample

{
  "MigrationTools": {
    "Version": "16.0",
    "Processors": [
      {
        "ProcessorType": "TfsWorkItemMigrationProcessor",
        "Enabled": "False",
        "FilterWorkItemsThatAlreadyExistInTarget": "False",
        "SourceName": "Source",
        "TargetName": "Target",
        "WIQLQuery": "SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @TeamProject AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan','Shared Steps','Shared Parameter','Feedback Request') ORDER BY [System.ChangedDate] desc"
      }
    ]
  }
}
top

Defaults

Defaults

{
  "MigrationTools": {
    "Version": "16.0",
    "Processors": [
      {
        "ProcessorType": "TfsWorkItemMigrationProcessor",
        "AttachRevisionHistory": "False",
        "Enabled": "False",
        "FilterWorkItemsThatAlreadyExistInTarget": "False",
        "FixHtmlAttachmentLinks": "True",
        "GenerateMigrationComment": "True",
        "MaxGracefulFailures": "0",
        "PauseAfterEachWorkItem": "False",
        "SkipRevisionWithInvalidAreaPath": "False",
        "SkipRevisionWithInvalidIterationPath": "False",
        "SourceName": "Source",
        "TargetName": "Target",
        "UpdateCreatedBy": "True",
        "UpdateCreatedDate": "True",
        "WIQLQuery": "SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @TeamProject AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan','Shared Steps','Shared Parameter','Feedback Request') ORDER BY [System.ChangedDate] desc",
        "WorkItemCreateRetryLimit": "5",
        "WorkItemIDs": null
      }
    ]
  }
}
top

Classic

Classic

{
  "$type": "TfsWorkItemMigrationProcessorOptions",
  "Enabled": false,
  "UpdateCreatedDate": true,
  "UpdateCreatedBy": true,
  "WIQLQuery": "SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @TeamProject AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan','Shared Steps','Shared Parameter','Feedback Request') ORDER BY [System.ChangedDate] desc",
  "FixHtmlAttachmentLinks": true,
  "WorkItemCreateRetryLimit": 5,
  "FilterWorkItemsThatAlreadyExistInTarget": false,
  "GenerateMigrationComment": true,
  "SourceName": "Source",
  "TargetName": "Target"
}
top

Metadata

top

Schema

This is the JSON schema that defines the structure and validation rules for this configuration.

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://devopsmigration.io/schema/schema.processors.tfsworkitemmigrationprocessor.json",
  "title": "TfsWorkItemMigrationProcessor",
  "description": "WorkItemMigrationConfig is the main processor used to Migrate Work Items, Links, and Attachments. Use `WorkItemMigrationConfig` to configure.",
  "type": "object",
  "properties": {
    "attachRevisionHistory": {
      "description": "This will create a json file with the revision history and attach it to the work item. Best used with `MaxRevisions` or `ReplayRevisions`.",
      "type": "boolean",
      "default": "false"
    },
    "enabled": {
      "description": "If set to `true` then the processor will run. Set to `false` and the processor will not run.",
      "type": "boolean"
    },
    "enrichers": {
      "description": "List of Enrichers that can be used to add more features to this processor. Only works with Native Processors and not legacy Processors.",
      "type": "array"
    },
    "filterWorkItemsThatAlreadyExistInTarget": {
      "description": "This loads all of the work items already saved to the Target and removes them from the Source work item list prior to commencing the run. While this may take some time in large data sets it reduces the time of the overall migration significantly if you need to restart.",
      "type": "boolean",
      "default": "true"
    },
    "fixHtmlAttachmentLinks": {
      "description": "**beta** If enabled this will fix any image attachments URL's, work item mention URL's or user mentions in the HTML fields as well as discussion comments. You must specify a PersonalAccessToken in the Source project for Azure DevOps; TFS should use integrated authentication.",
      "type": "boolean",
      "default": "true"
    },
    "generateMigrationComment": {
      "description": "If enabled, adds a comment recording the migration",
      "type": "boolean",
      "default": "true"
    },
    "maxGracefulFailures": {
      "description": "The maximum number of failures to tolerate before the migration fails. When set above zero, a work item migration error is logged but the migration will continue until the number of failed items reaches the configured value, after which the migration fails.",
      "type": "integer",
      "default": "0"
    },
    "pauseAfterEachWorkItem": {
      "description": "Pause after each work item is migrated",
      "type": "boolean",
      "default": "false"
    },
    "refName": {
      "description": "`Refname` will be used in the future to allow for using named Options without the need to copy all of the options.",
      "type": "string"
    },
    "skipRevisionWithInvalidAreaPath": {
      "description": "When set to true, this setting will skip a revision if the source area has not been migrated, has been deleted or is somehow invalid, etc.",
      "type": "boolean"
    },
    "skipRevisionWithInvalidIterationPath": {
      "description": "This will skip a revision if the source iteration has not been migrated i.e. it was deleted",
      "type": "boolean"
    },
    "sourceName": {
      "description": "This is the `IEndpoint` that will be used as the source of the Migration. Can be null for a write only processor.",
      "type": "string"
    },
    "targetName": {
      "description": "This is the `IEndpoint` that will be used as the Target of the Migration. Can be null for a read only processor.",
      "type": "string"
    },
    "updateCreatedBy": {
      "description": "If this is enabled the creation process on the target project will create the items with the original creation date. (Important: The item history is always pointed to the date of the migration, it's change only the data column CreateDate, not the internal create date)",
      "type": "boolean",
      "default": "true"
    },
    "updateCreatedDate": {
      "description": "If this is enabled the creation process on the target project will create the items with the original creation date. (Important: The item history is always pointed to the date of the migration, it's change only the data column CreateDate, not the internal create date)",
      "type": "boolean",
      "default": "true"
    },
    "wIQLQuery": {
      "description": "A work item query based on WIQL to select only important work items. To migrate all leave this empty. See [WIQL Query Bits](#wiql-query-bits)",
      "type": "string",
      "default": "SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @TeamProject AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan','Shared Steps','Shared Parameter','Feedback Request') ORDER BY [System.ChangedDate] desc"
    },
    "workItemCreateRetryLimit": {
      "description": "**beta** If set to a number greater than 0 work items that fail to save will retry after a number of seconds equal to the retry count. This allows for periodic network glitches not to end the process.",
      "type": "integer",
      "default": "5"
    },
    "workItemIDs": {
      "description": "A list of work items to import",
      "type": "array",
      "default": "[]"
    }
  }
}
top

More Information

The WorkItemMigrationContext processor is used for migrating work items from one Azure DevOps instance to another. This encompasses a variety of activities:

  1. Transferring Work Items Between Instances: The primary purpose of the processor is to transfer work items, including bugs, tasks, user stories, features, and more, from one Azure DevOps instance to another.

  2. Migrating Work Item History: The processor can also replicate the entire revision history of work items, providing continuity and maintaining a record of changes.

  3. Migrating Attachments and Links: The processor can transfer any attachments or links associated with work items. This includes both external links and internal links to other work items.

  4. Updating Metadata: If configured, the processor can update the “Created Date” and “Created By” fields on migrated work items to match the original items in the source instance.

  5. Filtering Work Items: The processor can be configured to only migrate certain work items based on their area or iteration paths.

Overall, the WorkItemMigrationContext processor is a comprehensive tool for transferring work items and their associated data and metadata between Azure DevOps instances. It should be used whenever there is a need to move work items between instances while preserving as much information as possible.


top

WIQL Query

The Work Item queries are all built using Work Item Query Language (WIQL) . We only support flat quereis that have FROM WorkItems in the query.

Note: A useful Azure DevOps Extension to explore WIQL is the WIQL Editor

top

Examples

You can use the WIQL Editor to craft a query in Azure DevOps.

A simple example config:

"WIQLQuery": "SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @TeamProject AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan','Shared Steps','Shared Parameter','Feedback Request') ORDER BY [System.ChangedDate] desc"

Scope to Area Path (Team data):

"WIQLQuery": "SELECT [System.Id] FROM WorkItems WHERE [System.TeamProject] = @TeamProject AND [System.AreaPath] UNDER 'project\Team 1\' AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan','Shared Steps','Shared Parameter','Feedback Request') ORDER BY [System.ChangedDate] desc"

Limit to specific work items (for testing purposes)

"WIQLQuery": "SELECT [System.Id] FROM WorkItems WHERE [System.Id] in (123,456,789) AND [System.TeamProject] = @TeamProject AND [System.AreaPath] UNDER 'project\Team 1\' AND [System.WorkItemType] NOT IN ('Test Suite', 'Test Plan','Shared Steps','Shared Parameter','Feedback Request') ORDER BY [System.ChangedDate] desc"
top

NodeBasePath Configuration

Moved to the TfsNodeStructure

top

Iteration Maps and Area Maps

Moved to the TfsNodeStructure

top

More Complex Team Migrations

The above options allow you to bring over a sub-set of the WIs (using the WIQLQueryBit) and move their area or iteration path to a default location. However you may wish to do something more complex e.g. re-map the team structure. This can be done with addition of a FieldMaps block to configuration in addition to the NodeBasePaths.

Using the above sample structure, if you wanted to map the source project Team 1 to target project Team A etc. you could add the field map as follows

A complete list of FieldMaps are available.

 "FieldMaps": [
   {
      "$type": "FieldValueMapConfig",
      "WorkItemTypeName": "*",
      "sourceField": "System.AreaPath",
      "targetField": "System.AreaPath",
      "defaultValue": "TargetProg",
      "valueMapping": {
        "SampleProj\\Team 1": "TargetProg\\Team A",
        "SampleProj\\Team 2": "TargetProg\\Team B"
        "SampleProj\\Team 3": "TargetProg\\Team C"
      }
    },
  ],

Note: These mappings could also be achieved with other forms of Field mapper e.g. RegexFieldMapConfig, but the value mapper as an example is easy to understand

top

Removed Properties

  • PrefixProjectToNodes - This option was removed in favour of the Area and Iteration Maps on TfsNodeStructure
Project Information
Azure DevOps Marketplace
YouTube Channel
Maintainer

Created and maintained by Martin Hinshelwood of nkdagility.com

Getting Support
Community Support
Questions & Discussions

The first place to look for usage, configuration, and general help.

Commercial Support

We provide training, ad-hoc support, and full service migrations through our professional services.

Azure DevOps Migration Services
Documentation