1
votes

My question is about TFS work items - does the TFS API support editing work item type field definitions? I need to make what is described in this link but using the C# TFS API.

Clarification #1: In the "Bug" work item type I created a definition called "Customer" and added its value items by wizard. Does the C# TFS API support editing or deleting items in that field?

Clarification #2: I can retrieve that values by using:

AllowedValuesCollection Collec = WorkItemStore.FieldDefinitions["Customer"].AllowedValues;

But the allowed values are Readonly without any public setters.

1

1 Answers

0
votes

Yes, You can export the definition via the Export method provided in the API (This method return a XML document for the definition) and then edit the content in the XML document. After you finish the modification, import the XML document via Import method.

Instruction about Export Method:https://msdn.microsoft.com/en-gb/library/microsoft.teamfoundation.workitemtracking.client.workitemtype.export.aspx

Instruction about Import Method:https://msdn.microsoft.com/en-gb/library/microsoft.teamfoundation.workitemtracking.client.workitemtypecollection.import.aspx

However, modify WIT definition via API is not an efficient way. It is better to use Power Tool Process Editor or witadmin command to import/export/edit WIT.