is there a way to retrieve possible state values开发者_C百科 for a workitem using .net api?
Yes.
WorkItemStore wis = tfs.GetService<WorkItemStore>();
WorkItemType wit = wis.Projects[0].WorkItemTypes[0];
FieldDefinition fd = wit.FieldDefinitions[CoreField.State];
for (int i = 0; i < fd.AllowedValues.Count; i++)
{
listBox1.Items.Add(fd.AllowedValues[i]);
}
精彩评论