如何从工作项ID中了解工作项类型?

时间:2015-08-28 08:35:20

标签: c# asp.net tfs

我有工作项ID

int id =int.Parse(Request.QueryString["ID"],System.Globalization.CultureInfo.CurrentCulture);
WorkItem item= DataManager.DevelopmentProject.Store.GetWorkItem(id);

我需要知道工作项类型是什么var type = item.GetType() in type fields?(错误,更改请求等)

2 个答案:

答案 0 :(得分:2)

我解决了这个问题

item.Fields["Work Item Type"].Value

答案 1 :(得分:-2)

我会用:

var type = item.GetType()
if(type == typeof(Bug))
{
    //Do something
}
...