tags:

views:

19

answers:

1

is there a way to retrieve possible state values for a workitem using .net api?

A: 

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]);
    }
Robaticus