是否可以以编程方式修改 TFS 2008/2010 工作项类型?

发布于 2024-10-12 12:32:36 字数 597 浏览 5 评论 0原文

有没有办法以编程方式修改 TFS 服务器上的工作项类型?

其背景是,我们使用类似于 VSTS.Build.FoundIn 的自定义字段,并希望用全局列表中的内部版本号填充它。对于单个项目来说这不是问题 - 使用全局列表的名称手动指定 SUGGESTEDVALUES 规则就足够了。这种方法的问题在于,它无法应用于我们在多个项目中重复使用的模板 - 无法在全局列表引用中为项目名称指定占位符。因此,每次我们创建TFS项目时,我们都需要手动修改全局列表名称,例如from

TFS 似乎有一个硬编码机制,用于为 FoundIn 和 IntegrationBuild 属性创建这些规则(请参阅 这个答案),我正在考虑为 TFS 事件创建一个处理程序,以模仿我们的自定义字段的这种逻辑。

Is there a way to programmatically modify a work item type on a TFS server?

The background on this is that we use a custom field similar to VSTS.Build.FoundIn and would like to have it populated with build numbers from a global list. For a single project it is not a problem - it's enough to manually specify the SUGGESTEDVALUES rule with the name of the global list. The problem with this approach is that it cannot be applied to a template that we reuse across multiple projects - there is no way to specify a placeholder for the project name in the global list reference. Hence, every time we create a TFS project we need to manually modify the global list name, like from
<GLOBALLIST name="Builds - [ProjectName]" /> to <GLOBALLIST name="Builds - Project1" />

It seems that TFS has a hardcoded mechanism for creating these rules for the FoundIn and IntegrationBuild properties (see this answer) and I was considering creating a handler for a TFS event to mimic this logic for our custom fields as well.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清风夜微凉 2024-10-19 12:32:36

您可以在 Team Foundation 服务器上订阅 ProjectCreatedEvent,然后使用 Shai Raig 的帖子来处理全局列表,以便在项目创建后创建全局列表。

http://blogs.microsoft.co.il/blogs/shair/archive/2010/03/08/tfs-api-part-23-create-global-list-xml-way.aspx< /a>

Martin Hinshelwood 在此处发表了一篇关于订阅服务器事件的好文章:
http: //blog.hinshelwood.com/archive/2010/09/16/team-foundation-server-2010-event-handling-with-subscribers.aspx

编辑:
您可以使用Team Foundation Server 电动工具 编辑工作项,并修改项目模板,以便工作项将具有新字段。

2011 年 1 月 20 日更新:
我发现这个问题回答了如何导入和导出工作项:
用于创建工作项模板的 TFS 客户端 API?

You could subscribe to ProjectCreatedEvent on the team foundation server and then use Shai Raig's post for working with global lists to create your global list after the project is created.

http://blogs.microsoft.co.il/blogs/shair/archive/2010/03/08/tfs-api-part-23-create-global-list-xml-way.aspx

Martin Hinshelwood has a good post on subscribing to server events here:
http://blog.hinshelwood.com/archive/2010/09/16/team-foundation-server-2010-event-handling-with-subscribers.aspx

EDIT:
You can use the Team Foundation Server Power Tools to edit work items, and also to modify the Project Templates so that work items will have the new field.

UPDATE 1/20/2011:
I found this question which answers how to import and export work items:
TFS Client APIs for creating workitem templates?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文