Reputation: 137
how to find all the Values of Field such as Done status,Workitemtype and state
Image attached.
workitem type fields with it's values
State field with all it's value's
Done status with it's value's
Upvotes: 1
Views: 720
Reputation: 51083
Yes, you could use client API to get allowedvalues by getting an instance of class FieldDefinition and referencing the AllowedValues property.
FieldDefinition.AllowedValues Property
A sample code for your reference.
var tfs = TeamFoundationServerFactory.GetServer("http://vstspioneer:8080/tfs/VSTSDF");
var workItemStore = (WorkItemStore)tfs.GetService(typeof(WorkItemStore));
var allowedValues = workItemStore.FieldDefinitions[xxx.xxx].AllowedValues;
foreach (String value in allowedValues)
{
Console.WriteLine(value);
}
Done status is not a build-in filed, should be a customize field.
More details please refer this blog: Get List of Allowed Values in TFS Work Item Field
Upvotes: 3