如何在 TFS 构建定义中获取签入注释/消息? [英] How can I get the checkin comment/message in TFS Build Definition?

查看:32
本文介绍了如何在 TFS 构建定义中获取签入注释/消息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以在 TFS 2013 构建定义(工作流文件)中获取签入注释/消息?我查看了 BuildDetail 但没有找到.

Is it possible to get the checkin comment/message in a TFS 2013 build definition (work flow file)? I have looked in BuildDetail but haven't found it.

推荐答案

Comment 是 变更集.您可以通过查询变更集来访问评论.下面的代码段在默认模板的 AssociateChangesetsAndWorkItems 活动之后添加时,循环遍历所有变更集 (associateChangesets) 并打印每个变更集 (cs) 注释.

Comment is a property a of a Changeset. You can access the comment by querying the changesets. The snippet below when added after the AssociateChangesetsAndWorkItems activity of the default template, loops through all changesets (associatedChangesets) and prints each changeset (cs) comment.

<ForEach x:TypeArguments="mtvc:Changeset" DisplayName="ForEach&lt;Changeset&gt;" Values="[associatedChangesets]">
  <ActivityAction x:TypeArguments="mtvc:Changeset">
    <ActivityAction.Argument>
      <DelegateInArgument x:TypeArguments="mtvc:Changeset" Name="cs" />
    </ActivityAction.Argument>
    <mtbwa:WriteBuildMessage Message="[String.Format(&quot;Changeset {0}: {1}&quot;, cs.ChangesetId, cs.Comment)]" />
  </ActivityAction>
</ForEach>

这篇关于如何在 TFS 构建定义中获取签入注释/消息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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