要构建的工作项/要发布的工作项,TFS 2015 数据库中的关系 [英] Work Item to Build / Work Item to Release, relationships in TFS 2015 database

查看:24
本文介绍了要构建的工作项/要发布的工作项,TFS 2015 数据库中的关系的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

工作项和构建/发布之间的关系存储在 Team Foundation Server 2015(更新 2.1)数据库中的什么位置?

Where are the relationships between Work Items and Build/Release stored in the Team Foundation Server 2015 (Update 2.1) database?

根据其文档,构建和发布 API 可以查询与构建/发布相关的任何工作项,如下所示:

The Build and Release APIs, as per their documentation, can query for any Work Items that relate to a Build/Release as follows:

http://tfsservername:8080/tfs/collectionname/Sandbox/_apis/build/builds/2872/workitems
http://tfsservername:8080/tfs/collectionname/Sandbox/_apis/Release/releases/19/workitem

WorkItem API 没有可用的此类调用.

The WorkItem API has no such call available.

仅背景信息:目前,TFS 2015 Update 2.1 中的工作项没有添加链接"到发布的选项——这使得工作项部署跟踪对于项目经理来说非常困难,管理数十个项目的数十个构建/发布.我想反转上述 API 调用使用的查询,以添加此功能.

Background info only: Currently Work Items in TFS 2015 Update 2.1 have no option to 'Add Link' to a Release - this makes Work Item deployment tracking very difficult for project managers, managing tens of builds/releases on tens of projects. I'd like to reverse the query used by the above API calls, to add this functionality.

推荐答案

目前,WorkItem、Release 和 Build API 都不包含任何基于 WorkItem 定位 Release 的调用.

Currently, neither the WorkItem, Release nor Build APIs include any calls to locate a Release based on WorkItems.

同样,Tfs_Warehouse 数据库中不存在此信息(通过启用 TFS 报告/分析创建),实际上在撰写本文时,那里根本没有发布"信息.

Likewise this information doesn't exist in the Tfs_Warehouse database (created by enabling TFS Reporting/Analysis), in fact at the time of writing this, there's no 'Release' information in there at all.

为了按工作项查找发布,您可以使用团队项目数据库来访问此信息.尽管不存在直接关系,但您可以对加载发布时 TFS 调用的各种存储过程进行逆向工程(此时显示工作项):

In order to find Releases by a Work Item, you can use the Team Project database to access this information. Although no direct relationship exists, you can reverse engineer the various stored procedures which are called by TFS when you load-up a release (WorkItems are displayed at this point):

DECLARE @workItem int;

SET @workItem = 751;

SELECT *
FROM Release.tbl_Release AS r
JOIN Release.tbl_ReleaseArtifactSource AS a ON a.ReleaseId = r.Id
JOIN Build.tbl_Change AS c ON c.BuildId = a.ArtifactVersionId
JOIN tbl_Mention AS m ON m.SourceId LIKE CONCAT('%', c.Descriptor, '%') -- Guid
WHERE m.ArtifactId = @workItem;

然后,您可以通过 Web API 或通过编程方式注入工作项团队查询并通过 TFS 扩展调用来使用此查询.

You can then utlitze this query by via Web API or by programmatically injecting as a WorkItem Team Query, and calling via TFS Extension.

这篇关于要构建的工作项/要发布的工作项,TFS 2015 数据库中的关系的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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