TFS 2010工作项目 - 工作项目链接 [英] TFS 2010 work item - Work item links

查看:170
本文介绍了TFS 2010工作项目 - 工作项目链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当用户从测试的情况下打开了一个错误,我需要检查是否测试用例链接到要求的项目,如果是的话,我需要的错误链接到需要的项目。

When a user opens a bug from a test case, I need to check if the test case is linked to a requirement item and if so I need to link the bug to the requirement item.

我如何知道这些信息?

我用下面这段code:

I use following piece of code:

WorkItemLinkCollection links = _workItem.WorkItemLinks;
foreach (WorkItemLink link in links)
{

}

但我不知道怎么弄的链接类型和链路ID。

but I don't know how to get the link type and link id.

推荐答案

WorkItemLink是一个抽象基类。 ExternalLink,超链接,RelatedLink从它继承这样的链接实例将是那些类型之一。所以,请检查您的实例的类型或'是'测试。您还可以得到RegisteredLink财产获取链接类型的友好名称。

WorkItemLink is an abstract base class. ExternalLink, HyperLink, and RelatedLink inherit from it so the link instance will be one of those types. So, check the type of your instance or test it with 'is'. You can also get the RegisteredLink property which gets the friendly name of the link type.

有关详细信息请参阅<一href="http://msdn.microsoft.com/en-us/library/microsoft.teamfoundation.workitemtracking.client.link(v=vs.80).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/microsoft.teamfoundation.workitemtracking.client.link(v=vs.80).aspx

关于,它的相关的id,每种类型是涉及不同的东西。例如,RelatedLink类型具有RelatedWorkItemId属性返回工作项目的ID,该工作项是有关。源ID是链路集合是工作项目的ID。

Concerning the id that it's related to, each type is related to something different. For example, the RelatedLink type has a RelatedWorkItemId property which returns the id of the workitem that this workitem is related to. The source id is the id of the workitem that the link collection is on.

<一个href="http://msdn.microsoft.com/en-US/library/microsoft.teamfoundation.workitemtracking.client.relatedlink_members(v=VS.80).aspx" rel="nofollow">http://msdn.microsoft.com/en-US/library/microsoft.teamfoundation.workitemtracking.client.relatedlink_members(v=VS.80).aspx

但是,超链接链接是不相关的另一工作项目。 - 它有一个位置属性来获取超链接位置作为字符串

But, a hyperlink link isn't related to another workitem - it has a location property to get the hyperlink location as a string.

<一个href="http://msdn.microsoft.com/en-US/library/microsoft.teamfoundation.workitemtracking.client.hyperlink_members(v=VS.80).aspx" rel="nofollow">http://msdn.microsoft.com/en-US/library/microsoft.teamfoundation.workitemtracking.client.hyperlink_members(v=VS.80).aspx

这篇关于TFS 2010工作项目 - 工作项目链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆