我使用以下代码以编程方式将WorkItem
发送至tfs
const String username = "user";
const String password = "123";
Uri url = new Uri("myurl");
NetworkCredential nc = new NetworkCredential();
nc.UserName = username;
nc.Password = password;
TfsTeamProjectCollection coll = new TfsTeamProjectCollection(url, nc);
coll.EnsureAuthenticated();
WorkItemStore workItemStore = coll.GetService<WorkItemStore>();
Project teamproject = workItemStore.Projects["Service"];
WorkItemType workItemType = teamproject.WorkItemTypes["Bug"];
WorkItem wi = new WorkItem(workItemType);
wi.Title = "thi has sent from Code";
wi.Description = "please remove this work Item";
wi.Tags = "c#";
wi.Save();
但是当我检查workItem
时,它只有标题,并且描述中没有任何内容。
我尝试在下面设置描述,但它不起作用。
wi.Fields[CoreField.Description].Value = "<p>hey hey</p> ";
答案 0 :(得分:1)
对于“错误”,该字段不是“说明”。它应该是“重新开始重现”,就像上图所示。
如下设置添加ReproSteps for bug:
wi.Fields["Microsoft.VSTS.TCM.ReproSteps"].Value = "set value here";