简体   繁体   中英

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. 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.

So How do I programmatically create a new TFS Task if it's possible? (it should be, Visual Basic and TFS are both Microsoft)

There is an example on MSDN. See this page: " Create a Work Item By Using the Client Object Model for 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();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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