繁体   English   中英

如何以编程方式创建新的TFS任务?

[英]How do I programmatically create a new TFS Task?

我正在寻找一个Visual Basic Windows窗体应用程序,它的输入字段与TFS浏览器版本上的新任务创建页面相似。 这个想法是自动完成一些表格填写工作,从而节省了时间(即,根据考虑到工作时间和周末的日期来计算时间估计,自动填写字段)

但是,当我搜索Google时,我会不断获得自定义TFS或如何使用界面进行新任务等结果,但是我正在寻找的是我应该用来创建新任务然后保存或搜索的类当前的现有任务。

那么,如果可能,我如何以编程方式创建新的TFS任务? (应该是,Visual Basic和TFS都是Microsoft)

在MSDN上有一个示例。 参见此页面:“ 使用Team Foundation的客户端对象模型创建工作项 ”。

该示例的核心是:

// Create the work item. 
WorkItem userStory = new WorkItem(workItemType)
{
    // The title is generally the only required field that doesn’t have a default value. 
    // You must set it, or you can’t save the work item. If you’re working with another
    // type of work item, there may be other fields that you’ll have to set.
    Title = "Recently ordered menu",
    Description = "As a return customer, I want to see items that I've recently ordered."
};

// Save the new user story. 
userStory.Save();

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM