【问题标题】:How do I programmatically create a new TFS Task?如何以编程方式创建新的 TFS 任务?
【发布时间】:2015-02-27 06:23:20
【问题描述】:

我希望创建一个 Visual Basic Windows 窗体应用程序,该应用程序具有与 TFS 浏览器版本上的新任务创建页面类似的输入字段。这个想法是自动化一些表格填写以节省时间(即,根据日期计算时间估计,同时考虑工作时间和周末,自动填写字段)

当我搜索谷歌时,我不断得到诸如自定义 TFS 或如何使用界面创建新任务之类的结果,但是我正在寻找的是我应该使用哪些类来创建新任务然后保存它或搜索当前现有的任务。

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

【问题讨论】:

    标签: vb.net winforms tfs tfs-workitem


    【解决方案1】:

    MSDN 上有一个例子。请参阅此页面:“Create a Work Item By Using the Client Object Model for 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();
    

    【讨论】:

    • 这不起作用。我得到 TokenUnauthorized。 {"TF30063: 您无权访问tfs.mycompany.com:8080/tfs。"} 但是我可以使用(设计不佳的)网络界面创建任务。
    猜你喜欢
    • 1970-01-01
    • 2017-06-02
    • 1970-01-01
    • 2015-10-30
    • 2019-04-14
    • 2019-02-18
    • 1970-01-01
    • 2011-09-28
    • 1970-01-01
    相关资源
    最近更新 更多