|
1 | 1 | --- |
2 | | -title: WIT Client OM to REST Migration Guide |
| 2 | +title: Migrate from WIT Client OM to REST APIs |
3 | 3 | titleSuffix: Azure DevOps Services |
4 | | -description: Migration guide to help you migrate your code from using WIT Client OM to REST based APIs |
| 4 | +description: Step-by-step migration guide for upgrading from legacy WIT Client OM to modern REST-based .NET client libraries with secure authentication. |
5 | 5 | ms.subservice: azure-devops-ecosystem |
| 6 | +ai-usage: ai-assisted |
6 | 7 | ms.topic: conceptual |
7 | 8 | ms.assetid: 30272A34-2CE1-41B3-BA7A-815D69309CBE |
8 | 9 | ms.author: chcomley |
9 | 10 | author: chcomley |
10 | 11 | monikerRange: 'azure-devops' |
11 | | -ms.date: 03/28/2019 |
| 12 | +ms.date: 07/14/2025 |
12 | 13 | --- |
13 | 14 |
|
14 | 15 | <!--- Supports FWLINK: https://go.microsoft.com/fwlink/?LinkId=692096 --> |
15 | 16 |
|
16 | | -# Migration guide |
| 17 | +# Migrate from WIT Client OM to REST APIs |
17 | 18 |
|
18 | 19 | [!INCLUDE [version-eq-azure-devops](../../includes/version-eq-azure-devops.md)] |
19 | 20 |
|
20 | | -This guide provides information to help migrate your .NET code from using [WIT Client OM](https://www.nuget.org/packages/Microsoft.TeamFoundationServer.ExtendedClient) to our REST-based [.NET Client Libraries](dotnet-client-libraries.md). The following table lists common work tracking scenarios with links to their respected API documentation. |
| 21 | +> [!IMPORTANT] |
| 22 | +> **Legacy technology replacement required** |
| 23 | +> |
| 24 | +> The [WIT Client OM](https://www.nuget.org/packages/Microsoft.TeamFoundationServer.ExtendedClient) (Work Item Tracking Client Object Model) is legacy technology that should be replaced with modern [REST-based .NET client libraries](dotnet-client-libraries.md). Migration provides better performance, security, and cross-platform support. |
21 | 25 |
|
22 | | -For sample code covered in these scenarios, see the [GitHub Azure DevOps WIT Client OM Migration Guide](https://github.com/Microsoft/azure-devops-wit-client-om-migration-guide). |
| 26 | +This guide helps you migrate your .NET code from the deprecated WIT Client OM to modern REST APIs. The migration offers significant benefits: |
23 | 27 |
|
24 | | -## Common scenarios |
| 28 | +**✅ Modern advantages:** |
| 29 | +- Asynchronous operations for better performance |
| 30 | +- Modern authentication with managed identities and service principals |
| 31 | +- Cross-platform support (.NET Core, .NET 5+, and .NET Framework) |
| 32 | +- Active development and ongoing support |
25 | 33 |
|
26 | | -| Scenario | WIT Client OM | REST based | |
| 34 | +**❌ Legacy limitations:** |
| 35 | +- Limited to .NET Framework and Windows only |
| 36 | +- Synchronous, blocking operations |
| 37 | +- Outdated authentication methods |
| 38 | + |
| 39 | +## Migration overview |
| 40 | + |
| 41 | +**Step 1:** Update NuGet packages - Replace WIT Client OM with modern REST client packages |
| 42 | +**Step 2:** Update authentication - Migrate to secure, modern authentication methods |
| 43 | +**Step 3:** Convert operations - Replace synchronous calls with asynchronous REST operations |
| 44 | + |
| 45 | +For detailed code examples and step-by-step migration samples, see the [GitHub Azure DevOps WIT Client OM Migration Guide](https://github.com/Microsoft/azure-devops-wit-client-om-migration-guide). |
| 46 | + |
| 47 | +## Common scenarios migration table |
| 48 | + |
| 49 | +The following table shows how to migrate common work item operations from legacy WIT Client OM to modern REST APIs: |
| 50 | + |
| 51 | +| **Scenario** | **Legacy WIT Client OM** | **Modern REST API** | |
27 | 52 | | ------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------- | |
28 | 53 | | Get list of work items | [WorkItemStore.Query](/previous-versions/visualstudio/visual-studio-2013/bb140399%28v%3dvs.120%29) | [Work Items - List](/rest/api/azure/devops/wit/work-items/list) | |
29 | 54 | | Get single work item | [WorkItemStore.GetWorkItem](/previous-versions/visualstudio/visual-studio-2013/bb140391%28v%3dvs.120%29) | [Work Items - Get Work Item](/rest/api/azure/devops/wit/work-items/get-work-item) | |
30 | 55 | | Create new work item | [WorkItem](</previous-versions/visualstudio/visual-studio-2013/bb179831(v%3dvs.120)>) | [Work Items - Create](/rest/api/azure/devops/wit/work-items/create) | |
31 | | -| Update existing work item | [WorkItem.Fields](</previous-versions/visualstudio/visual-studio-2013/bb164805(v%3dvs.120)>) | [Work Items - Update - Update a field](/rest/api/azure/devops/wit/work-items/update#update-a-field) | |
32 | | -| Validate a work item | [WorkItem.IsValid()](</previous-versions/visualstudio/visual-studio-2013/bb140421(v%3dvs.120)>),<br/>[WorkItem.Validate()](</previous-versions/visualstudio/visual-studio-2013/bb140427(v%3dvs.120)>) | [Work Items - Update - Validate only](/rest/api/azure/devops/wit/work-items/update#validate-only-update) | |
33 | | -| Create a link to an existing work item | [WorkItem.WorkItemLinks.Add](</previous-versions/visualstudio/visual-studio-2013/bb140132(v%3dvs.120)>) | [Work Item - Update - Add a link](/rest/api/azure/devops/wit/work-items/update#add-a-link) | |
34 | | -| Add a comment | [WorkItem.History](</previous-versions/visualstudio/visual-studio-2013/bb164807(v%3dvs.120)>) | [Work Item - Update - Update a field](/rest/api/azure/devops/wit/work-items/update#update-a-field) | |
35 | | -| Create a hyperlink | [WorkItem.Links.Add()](/previous-versions/visualstudio/visual-studio-2013/bb140133%28v%3dvs.120%29) | [Work Item - Update - Add a hyperlink](/rest/api/azure/devops/wit/work-items/update#add-a-hyperlink) | |
36 | | -| Add an attachment | [WorkItem.Attachments.Add()](/previous-versions/visualstudio/visual-studio-2013/bb164795%28v%3dvs.120%29) | [Work Item - Update - Add an attachment](/rest/api/azure/devops/wit/work-items/update#add-an-attachment) | |
37 | | -| Query work items using WIQL | [WorkItemStore.Query()](/previous-versions/visualstudio/visual-studio-2013/bb140399%28v%3dvs.120%29) | [Wiql - Query by Wiql](/rest/api/azure/devops/wit/wiql/query%20by%20wiql?view=azure-devops-rest-6.0&preserve-view=true) | |
38 | | -| Run an existing query to get a list of work items | [WorkItemStore.Query()](/previous-versions/visualstudio/visual-studio-2013/bb140399%28v%3dvs.120%29) | [Wiql - Query by ID](/rest/api/azure/devops/wit/wiql/query%20by%20id?view=azure-devops-rest-6.0&preserve-view=true) | |
39 | | -| Get list of work item types for your project | [Category.WorkItemTypes](/previous-versions/visualstudio/visual-studio-2013/ff733906%28v%3dvs.120%29) | [Work Item Types - List](/rest/api/azure/devops/wit/work%20item%20types/list?view=azure-devops-rest-5.1&preserve-view=true) | |
| 56 | +| Update existing work item | [WorkItem.Fields](</previous-versions/visualstudio/visual-studio-2013/bb164805(v%3dvs.120)>) | [Work Items - Update](/rest/api/azure/devops/wit/work-items/update#update-a-field) | |
| 57 | +| Validate a work item | [WorkItem.IsValid()](</previous-versions/visualstudio/visual-studio-2013/bb140421(v%3dvs.120)>),<br/>[WorkItem.Validate()](</previous-versions/visualstudio/visual-studio-2013/bb140427(v%3dvs.120)>) | [Work Items - Update (validate only)](/rest/api/azure/devops/wit/work-items/update#validate-only-update) | |
| 58 | +| Create a link to an existing work item | [WorkItem.WorkItemLinks.Add](</previous-versions/visualstudio/visual-studio-2013/bb140132(v%3dvs.120)>) | [Work Items - Update (add link)](/rest/api/azure/devops/wit/work-items/update#add-a-link) | |
| 59 | +| Add a comment | [WorkItem.History](</previous-versions/visualstudio/visual-studio-2013/bb164807(v%3dvs.120)>) | [Work Items - Update (add comment)](/rest/api/azure/devops/wit/work-items/update#update-a-field) | |
| 60 | +| Create a hyperlink | [WorkItem.Links.Add()](/previous-versions/visualstudio/visual-studio-2013/bb140133%28v%3dvs.120%29) | [Work Items - Update (add hyperlink)](/rest/api/azure/devops/wit/work-items/update#add-a-hyperlink) | |
| 61 | +| Add an attachment | [WorkItem.Attachments.Add()](/previous-versions/visualstudio/visual-studio-2013/bb164795%28v%3dvs.120%29) | [Work Items - Update (add attachment)](/rest/api/azure/devops/wit/work-items/update#add-an-attachment) | |
| 62 | +| Query work items using WIQL | [WorkItemStore.Query()](/previous-versions/visualstudio/visual-studio-2013/bb140399%28v%3dvs.120%29) | [Wiql - Query by Wiql](/rest/api/azure/devops/wit/wiql/query%20by%20wiql) | |
| 63 | +| Run an existing query to get work items | [WorkItemStore.Query()](/previous-versions/visualstudio/visual-studio-2013/bb140399%28v%3dvs.120%29) | [Wiql - Query by ID](/rest/api/azure/devops/wit/wiql/query%20by%20id) | |
| 64 | +| Get list of work item types for project | [Category.WorkItemTypes](/previous-versions/visualstudio/visual-studio-2013/ff733906%28v%3dvs.120%29) | [Work Item Types - List](/rest/api/azure/devops/wit/work-item-types/list) | |
40 | 65 | | Get work item type details | [Category.WorkItemTypes](/previous-versions/visualstudio/visual-studio-2013/ff733906%28v%3dvs.120%29) | [Work Item Types - Get](/rest/api/azure/devops/wit/work-item-types/get) | |
41 | 66 | | Get list of fields for a work item type | [WorkItemType.FieldDefinitions](/previous-versions/visualstudio/visual-studio-2013/bb164788%28v%3dvs.120%29) | [Work Item Types Field - List](/rest/api/azure/devops/wit/work-item-types-field/list) | |
42 | 67 | | Get field details | [WorkItemType.FieldDefinitions](/previous-versions/visualstudio/visual-studio-2013/bb164788%28v%3dvs.120%29) | [Work Item Types Field - Get](/rest/api/azure/devops/wit/work-item-types-field/get) | |
43 | 68 |
|
44 | | -## Resources |
| 69 | +## Authentication migration |
| 70 | + |
| 71 | +**Legacy authentication (❌ Replace):** |
| 72 | +```csharp |
| 73 | +// WIT Client OM with basic authentication |
| 74 | +using (var tpc = new TfsTeamProjectCollection(new Uri(collectionUri))) |
| 75 | +{ |
| 76 | + tpc.Authenticate(); |
| 77 | + var workItemStore = tpc.GetService<WorkItemStore>(); |
| 78 | +} |
| 79 | +``` |
| 80 | + |
| 81 | +**Modern authentication (✅ Recommended):** |
| 82 | +```csharp |
| 83 | +// REST client with managed identity (for Azure-hosted apps) |
| 84 | +var credentials = new VssAzureIdentityCredential(); |
| 85 | +using var connection = new VssConnection(new Uri(collectionUri), credentials); |
| 86 | +var witClient = connection.GetClient<WorkItemTrackingHttpClient>(); |
| 87 | + |
| 88 | +// Alternative: Service principal for CI/CD |
| 89 | +// var credentials = new VssServicePrincipalCredential(clientId, clientSecret, tenantId); |
| 90 | +
|
| 91 | +// Alternative: PAT for development/testing |
| 92 | +// var credentials = new VssBasicCredential(string.Empty, personalAccessToken); |
| 93 | +``` |
| 94 | + |
| 95 | +## Next steps and resources |
| 96 | + |
| 97 | +### 📖 Essential migration resources |
| 98 | +- **[Modern .NET client library samples](../get-started/client-libraries/samples.md)** - Production-ready code examples with modern authentication |
| 99 | +- **[Authentication guidance](../get-started/authentication/authentication-guidance.md)** - Choose the right authentication method for your scenario |
| 100 | +- **[.NET client libraries concepts](dotnet-client-libraries.md)** - Understanding the modern client architecture |
| 101 | + |
| 102 | +### 🔧 Code examples and tools |
| 103 | +- **[Migration guide with code samples](https://github.com/Microsoft/azure-devops-wit-client-om-migration-guide)** - GitHub repository with detailed migration examples |
| 104 | +- **[Work Item Tracking REST API documentation](/rest/api/azure/devops/wit/)** - Complete API reference with examples |
45 | 105 |
|
46 | | -- [Migrate data from Azure DevOps Server to Azure DevOps Services](../../migrate/migration-overview.md) |
47 | | -- [Migration guide with code samples](https://github.com/Microsoft/azure-devops-wit-client-om-migration-guide) |
48 | | -- [Work Item Tracking REST API documentation](/rest/api/azure/devops/wit/?preserve-view=true&view=azure-devops-rest-6.0) |
| 106 | +### 🆘 Support and community |
| 107 | +- **[Azure DevOps Developer Community](https://developercommunity.visualstudio.com/spaces/21/index.html)** - Ask questions and get help |
| 108 | +- **[Migration guide issues](https://github.com/Microsoft/azure-devops-wit-client-om-migration-guide/issues)** - Report missing scenarios or get specific help |
49 | 109 |
|
50 | | -## Support |
| 110 | +### 🔄 Related migrations |
| 111 | +- **[Migrate data from Azure DevOps Server to Azure DevOps Services](../../migrate/migration-overview.md)** - Service migration guidance |
| 112 | +- **[Legacy SOAP client samples](../get-started/client-libraries/soapSamples.md)** - Reference for other legacy client patterns |
51 | 113 |
|
52 | | -Looking for a help on a scenario that we missed? If so, create a new issue on the [migration guide](https://github.com/Microsoft/azure-devops-wit-client-om-migration-guide) project and we'll add the scenario to the repo. |
| 114 | +> [!TIP] |
| 115 | +> **Start your migration:** Begin with [authentication guidance](../get-started/authentication/authentication-guidance.md) to choose the right approach, then see [.NET client library samples](../get-started/client-libraries/samples.md) for working code examples. |
0 commit comments