[英]How do I programmatically create a new TFS Task?
I'm looking to create a Visual Basic Windows Form Application which has similar input fields to the new task creation page on the browser version of TFS. 我正在寻找一个Visual Basic Windows窗体应用程序,它的输入字段与TFS浏览器版本上的新任务创建页面相似。 the idea is to automate some of the form filling saving up on time (is, calculating time estimates based on dates taking into account work hours and weekends, automatically filling out fields)
这个想法是自动完成一些表格填写工作,从而节省了时间(即,根据考虑到工作时间和周末的日期来计算时间估计,自动填写字段)
When i search Google however i keep getting results like customizing TFS or how to make a new task using the interface, however what i am looking for is what classes i'm supposed to use to create a new task and then to save it or search current existing tasks. 但是,当我搜索Google时,我会不断获得自定义TFS或如何使用界面进行新任务等结果,但是我正在寻找的是我应该用来创建新任务然后保存或搜索的类当前的现有任务。
So How do I programmatically create a new TFS Task if it's possible? 那么,如果可能,我如何以编程方式创建新的TFS任务? (it should be, Visual Basic and TFS are both Microsoft)
(应该是,Visual Basic和TFS都是Microsoft)
There is an example on MSDN. 在MSDN上有一个示例。 See this page: " Create a Work Item By Using the Client Object Model for Team Foundation ".
参见此页面:“ 使用Team Foundation的客户端对象模型创建工作项 ”。
The core of the example is: 该示例的核心是:
// 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.