{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/microsoft-azure-devops/json-schema/microsoft-azure-devops-work-item-type-schema.json",
  "title": "WorkItemType",
  "description": "Definition of a work item type",
  "x-generated": "2026-11-04",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/microsoft-azure-devops-work-item-types-api-openapi.yml#/components/schemas/WorkItemType",
  "type": "object",
  "properties": {
    "name": {
      "type": "string",
      "description": "Display name of the work item type"
    },
    "referenceName": {
      "type": "string",
      "description": "Reference name used in WIQL queries"
    },
    "description": {
      "type": "string",
      "description": "Description of the work item type and its intended use"
    },
    "color": {
      "type": "string",
      "description": "Hex color code for the work item type icon"
    },
    "icon": {
      "type": "object",
      "description": "Icon information for the work item type",
      "properties": {
        "id": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "format": "uri"
        }
      }
    },
    "isDisabled": {
      "type": "boolean",
      "description": "Whether the work item type is disabled"
    },
    "xmlForm": {
      "type": "string",
      "description": "XML definition of the work item type form"
    },
    "fields": {
      "type": "array",
      "description": "Fields defined for this work item type",
      "items": {
        "$ref": "#/$defs/WorkItemTypeFieldInstance"
      }
    },
    "fieldInstances": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/WorkItemTypeFieldInstance"
      }
    },
    "transitions": {
      "type": "object",
      "description": "Map of allowed state transitions",
      "additionalProperties": {
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "to": {
              "type": "string"
            },
            "actions": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          }
        }
      }
    },
    "states": {
      "type": "array",
      "description": "Valid states for this work item type",
      "items": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          },
          "color": {
            "type": "string"
          },
          "category": {
            "type": "string"
          }
        }
      }
    },
    "url": {
      "type": "string",
      "format": "uri"
    }
  },
  "$defs": {
    "WorkItemTypeFieldInstance": {
      "type": "object",
      "description": "A field instance within a work item type",
      "properties": {
        "fieldName": {
          "type": "string",
          "description": "Display name of the field"
        },
        "field": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string"
            },
            "referenceName": {
              "type": "string"
            },
            "url": {
              "type": "string",
              "format": "uri"
            }
          }
        },
        "referenceName": {
          "type": "string",
          "description": "Reference name (e.g., System.Title)"
        },
        "defaultValue": {
          "description": "Default value for the field"
        },
        "allowedValues": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Allowed values for fields with a restricted set of values"
        },
        "helpText": {
          "type": "string"
        },
        "alwaysRequired": {
          "type": "boolean"
        },
        "readOnly": {
          "type": "boolean"
        }
      }
    }
  }
}