This documentation is archived and is not being maintained.

Edit and Save Work Items by Using the Client Object Model for Team Foundation

You can change the Fields, Links, and Attachments of a WorkItem and then try to save those changes by using either the WorkItemSave or WorkItemStoreBatchSave method.

When you try to save your changes, they are evaluated against the rules for the WorkItemType. If the values that you specify follow those rules, the WorkItem is saved, its revision is incremented, and its history is updated with the most recent changes. Otherwise, the WorkItem is not saved, its revision is not incremented, and its history is not updated.

Note Note

You can save more than one WorkItem or WorkItemLink in a single round trip by using the WorkItemStoreBatchSave method.

The example demonstrates how to edit and save work items and how to use the WorkItemIsValid and WorkItemIsDirty properties.

To use this example

  1. Create a C# ( or VB ) console application.

  2. Add references to the following assemblies:

  3. Replace the contents of Program.cs ( or Module1.vb ) with the following example:

No code example is currently available or this language may not be supported.
Show: