我想在我的软件中添加一个反馈机制。
从用户那里获取TFS Feedback Response
所需的信息,然后为其创建TFS工作项是个好主意。
所以我的明确问题是:
问题:如何添加“反馈”#39;使用C#给出Title
,Description
,Team Project
和Team Server
的工作项?
答案 0 :(得分:2)
非常简单:
var cred = new NetworkCredential("UserName", "Password", "Domain");
var tfs =
new TfsTeamProjectCollection(new Uri("YourServerUrl/Collection"), cred);
var workItemStore = (WorkItemStore)tfs.GetService(typeof(WorkItemStore));
var workItemTypes = workItemStore.Projects["ProjectName"].WorkItemTypes;
var workItemType = workItemTypes["Feedback Response"];
var workItem = new WorkItem(workItemType);
workItem.Title = "Feedback Response 1";
workItem.Description = "Totally awesome piece of software!";
workItem.Save();
域是实际域,或者在工作组情况下,它将是托管TFS应用程序层的服务器的名称。Source
答案基于文章TFS 2010 API - Create WorkItems(Bugs)并在VS 2013 + TFS 2013上进行了测试。