Field Literal Map

The Field Literal Map sets a static, constant value to a target field on all migrated work items. This is useful for applying consistent values across work items during migration, such as setting default states, assigning standard tags, or populating fields with organizational defaults.

Last updated: September 10, 2025 | Edit this page | Discuss this page
top

Overview

The Field Literal Map is one of the simplest and most straightforward field maps available in the Azure DevOps Migration Tools. It assigns a predefined static value to a target field on all work items that match the specified criteria, regardless of the source field values.

This field map is particularly useful when you need to standardize certain field values across all migrated work items or when the target system requires specific values that don’t exist in the source system.

Maps a literal (static) value to a target field, useful for setting constant values across all migrated work items.

top

How It Works

The Field Literal Map operates with simple logic:

  1. Configuration: Defines a static value and target field during setup
  2. Execution: For each matching work item, sets the target field to the specified literal value
  3. Overwrite: Replaces any existing value in the target field with the configured literal value
top

Use Cases

This field map is commonly used for:

  • Default State Assignment: Setting all migrated work items to a specific state (e.g., “New” or “Imported”)
  • Organizational Standards: Applying company-specific field values across all work items
  • Process Compliance: Ensuring required fields have valid default values in the target system
  • Batch Tagging: Adding consistent tags or labels to identify migrated work items
  • Field Initialization: Setting default values for custom fields that don’t exist in the source
  • Area Path Defaults: Assigning work items to a specific area when source areas don’t map directly
top

Configuration Structure

Parameter
Type
Required
Description
Default Value
Parameter:
ApplyTo
Type:
List
Required:
false
Description:
A list of Work Item Types that this Field Map will apply to. If the list is empty it will apply to all Work Item Types. You can use “*” to apply to all Work Item Types.
Default:
missing XML code comments
Parameter:
Enabled
Type:
Boolean
Required:
false
Description:
If set to true then the Fieldmap will run. Set to false and the processor will not run.
Default:
missing XML code comments
Parameter:
targetField
Type:
String
Required:
false
Description:
Gets or sets the name of the target field that will be set to the specified literal value.
Default:
missing XML code comments
Parameter:
value
Type:
String
Required:
false
Description:
Gets or sets the literal value that will be assigned to the target field during migration.
Default:
missing XML code comments
top

Sample

{
  "MigrationTools": {
    "Version": "16.0",
    "CommonTools": {
      "FieldMappingTool": {
        "FieldMaps": [
          {
            "FieldMapType": "FieldLiteralMap",
            "ApplyTo": [
              "SomeWorkItemType"
            ],
            "targetField": "Custom.SomeField",
            "value": "New field value"
          }
        ]
      }
    }
  }
}
top

Defaults

{
  "MigrationTools": {
    "Version": "16.0",
    "CommonTools": {
      "FieldMappingTool": {
        "FieldMaps": [
          {
            "FieldMapType": "FieldLiteralMap",
            "ApplyTo": [
              "*"
            ]
          }
        ]
      }
    }
  }
}
top

Basic Examples

top

Setting a Default State

{
  "FieldMapType": "FieldLiteralMap",
  "ApplyTo": ["Bug", "Task", "User Story"],
  "value": "New",
  "targetField": "System.State"
}
top

Adding Migration Tags

{
  "FieldMapType": "FieldLiteralMap",
  "ApplyTo": ["*"],
  "value": "Migrated-2024",
  "targetField": "System.Tags"
}
top

Setting Default Area Path

{
  "FieldMapType": "FieldLiteralMap",
  "ApplyTo": ["*"],
  "value": "MyProject\\Imported Items",
  "targetField": "System.AreaPath"
}
top

Assigning Default Priority

{
  "FieldMapType": "FieldLiteralMap",
  "ApplyTo": ["Bug"],
  "value": "2",
  "targetField": "Microsoft.VSTS.Common.Priority"
}
top

Data Type Support

The Field Literal Map can work with various data types:

top

String Values

  • Text fields, states, area paths, iteration paths
  • Tags (note: tags are typically additive, so consider existing values)
top

Numeric Values

  • Priority, severity, effort, and other numeric fields
  • Values should be provided as strings in the configuration
top

Boolean Values

  • True/false fields should be specified as “True” or “False” strings
top

Date Values

  • ISO 8601 format recommended for date fields
  • Example: “2024-01-15T00:00:00Z”
top

Best Practices

top

Value Validation

  • Ensure the literal value is valid for the target field type
  • Verify that state values exist in the target work item type definition
  • Check that area paths and iteration paths exist in the target project
top

Strategic Application

  • Use ApplyTo to target specific work item types when appropriate
  • Consider the impact of overwriting existing field values
  • Test with a small subset before applying to all work items
top

Field Compatibility

  • Verify target fields exist in the destination work item types
  • Ensure field values comply with any validation rules in the target system
  • Consider field length limitations for string values
top

Considerations and Limitations

top

Value Overwriting

The Field Literal Map always overwrites the target field value, regardless of existing content. If you need to preserve existing values, consider using conditional field maps instead.

top

Field Validation

The target system’s field validation rules still apply. Invalid values will cause migration errors.

top

Performance

Field Literal Maps are highly performant since they don’t require complex logic or data transformation.

top

Error Handling

The field map includes basic validation:

  • Configuration Validation: Ensures the target field is specified
  • Runtime Execution: Direct field assignment with minimal error handling
  • Field Existence: Target field must exist on the work item type
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.fieldmaps.fieldliteralmap.json",
  "title": "FieldLiteralMap",
  "description": "Maps a literal (static) value to a target field, useful for setting constant values across all migrated work items.",
  "type": "object",
  "properties": {
    "ApplyTo": {
      "description": "A list of Work Item Types that this Field Map will apply to. If the list is empty it will apply to all Work Item Types. You can use \"*\" to apply to all Work Item Types.",
      "type": "array"
    },
    "Enabled": {
      "description": "If set to `true` then the Fieldmap will run. Set to `false` and the processor will not run.",
      "type": "boolean"
    },
    "targetField": {
      "description": "Gets or sets the name of the target field that will be set to the specified literal value.",
      "type": "string"
    },
    "value": {
      "description": "Gets or sets the literal value that will be assigned to the target field during migration.",
      "type": "string"
    }
  }
}
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