Click here to Skip to main content
15,887,027 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I'm trying to retrieve details of work items from TFS as below

C#
tpc = new TfsTeamProjectCollection(new Uri(tfsCollection));
           string query = @"Select [State], [Title],[Severity] From WorkItems Where [Work Item Type] = 'Bug'  AND [Area Path] = '" + areaPath + "'  AND  [Iteration Path] = '" + iterationPath + "'  AND [Team Project]='" + projectName + "'";
           workItemStore = (WorkItemStore)tpc.GetService(typeof(WorkItemStore));



I'm able to retrieve State and Title of the workitem but not Severity.

There is no property for Severity in WorkItemCollection.

F#
 WorkItemData workItemData = new WorkItemData();
workItemData.WorkItemTitle = queryResults[i].Title;
workItemData.WorkItemState = queryResults[i].State;


How can we retrieve Severity and Priority of the workitem from TFS programmatically?
It would be great if you can help me out..
Posted

1 solution

You can get any field value as below,

queryResults[i].Fields["Severity"].Value;
 
Share this answer
 
v2
Comments
Ravi Bhavnani 30-Jun-18 14:51pm    
This doesn't work for Severity.

/ravi

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900