Get List AssignedTo and Priority

Hello how can I get a list of all valid "assigned To" users, and a list with all priories?

I can't find it in the WorkItemStore?

WorkItemStore store = (WorkItemStore)tfs.GetService(typeof(WorkItemStore));

Thanks!

regards

Simon

[422 byte] By [SimonGorski] at [2007-12-24]
# 1

One way would be to get all the allowed values of "AssignedTo" field.

WorkItemStore store = (WorkItemStore)tfs.GetService(typeof(WorkItemStore));

Project proj = store.Projects["<Project_Name>"];

WorkItem wi =newWorkItem(proj.WorkItemTypes["<WorkItem_Type>"]);

string[] users =newstring[wi.Fields["System.AssignedTo"].AllowedValues.Count];

int i = 0;

foreach (string userin tsk.Fields["System.AssignedTo"].AllowedValues)

{

users[i++] = user;

}

Sane way you can get other fields values.

Regards,

SmithaSSaligrama at 2007-10-8 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Work Item Tracking...
# 2

Hi Simon,

The list of allowed values for a certain field is specific to the state of a certain work item. Therefore, the WorkItemStore cannot expose such a list since all values are not valid at all times and for all work item types.

Smitha's code shows you the way to get the list of allowed values for a field - per workitem.

Thanks,
Karthik

KarthikSubramanyam at 2007-10-8 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Work Item Tracking...
# 3

Hello!

Thanks a lot!

Regards

Simon

SimonGorski at 2007-10-8 > top of Msdn Tech,Visual Studio Team System,Team Foundation Server - Work Item Tracking...

Visual Studio Team System

Site Classified