tfs - 在 TFS 2015 中复制工作项

标签 tfs azure-devops tfs-workitem

我们使用的是 TFS 2015 和 CMMI 过程模板。

我正在尝试了解如何从问题工作项创建完整副本,其中目标工作项类型应为需求。 对于完整副本,我的意思是在需求中也可用的问题的所有字段的值(例如标题、描述、状态、区域路径、迭代......)应该被复制以及到其他工作项的所有链接( child 、 parent 、亲属、继任者、前任等)。

在 VSO 中使用“复制”将 f.e.不要复制问题(任务)的子链接。相反,它创建了一个与源问题“相关”的...

任何有关如何实现这一点的建议都将不胜感激。

最佳答案

您可以使用 TFS API从 TFS 读取测试用例,然后根据您希望复制的属性创建一个新的测试用例。这是 creating a Test Case 的一些示例代码:

   using System;
using Microsoft.TeamFoundation.Client;
using Microsoft.TeamFoundation.WorkItemTracking.Client;

namespace WorkItemTrackingSample
{
    class Program
    {
        static void Main(string[] args)
        {            // Connect to the server and the store, and get the WorkItemType object
            // for user stories from the team project where the user story will be created. 
            Uri collectionUri = (args.Length < 1) ?
                new Uri("http://server:port/vdir/DefaultCollection") : new Uri(args[0]);
            TfsTeamProjectCollection tpc = new TfsTeamProjectCollection(collectionUri);
            WorkItemStore workItemStore = tpc.GetService<WorkItemStore>();
            Project teamProject = workItemStore.Projects["DinnerNow"];
            WorkItemType workItemType = teamProject.WorkItemTypes["Test Case"];

            // 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();
        }
    }
}

关于tfs - 在 TFS 2015 中复制工作项,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35089348/

相关文章:

tfs - 是否有基于 Web 的工具来允许用户提交工作项?

c# - 如何防止 TFS 2013 锁定二进制文件?

TFS 搁置集从一个分支迁移到另一个分支

azure - npm 错误缺少脚本 : build (Set up CI with Azure Pipelines)

rest - 使用 (ADO Rest api ) 列出 Azure Repos 中特定提交的标签

azure-devops - 如何使用平面列表查询列出与史诗关联的功能?

c# - 在 TFS 中的解决方案之间共享代码

tfs - 合并 - checkin 评论

Azure DevOps Pipeline - YAML 格式错误?

visual-studio - 如何将工作项从 TFS 迁移到 Visual Studio Team Services