如何只读 TFS 工作项字段但不隐藏 [英] How to readonly of the TFS work item field but not hidden

查看:19
本文介绍了如何只读 TFS 工作项字段但不隐藏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我向 tfs 添加了新的工作项.例如工作项类型:cab,状态:new、active、closed.

I added new work item to tfs. for example work item type: cab, states: new, active, closed.

我在表单布局中添加了字段和表单元素.例如客户备注(类型:字符串)

I added field and form element to form layout. for example customer note (type: string)

在流程模板工作流中添加了关于活动状态的只读字段规则.

added readonly field rule on active state in process template workflow.

但是当我没有输入文本并将 new 更改为 active 时它是隐藏的.

But it is hidden when I did'nt input text with change new to active.

为什么?即使我没有输入数据,我也想看到我的字段.

why? I want to visible my field even so I did not input data.

我该怎么办?

谢谢

推荐答案

以下是 VS 2012 未来的 ReadOnly 字段规则.请注意,这不是 VS 2010 及之前的行为.不幸的是,这是没有记录的,恕我直言,这是违反直觉的.

Here's the rules on ReadOnly fields for VS 2012 going forward. Note that this was NOT the behavior for VS 2010 and before. This is unfortunately undocumented and IMHO counter-intuitive.

  1. 如果字段为只读且为空,它将从表单中消失
  2. 如果它只是 ReadOnly 但有一个值,它仍然会在表单上但不可编辑.

例如,PBI 工作项有一个条件,即当它进入完成"状态时,它使业务价值"和工作量字段都变为只读,如下面的 XML 中所示来自其工作项类型定义(WITD):

For example, the PBI work item has a condition that when it goes into the "Done" state, it makes both the "Business Value" and Effort field go ReadOnly as shown in the XML below from its Work Item Type Definition (WITD):

    <STATE value="Done">
      <FIELDS>
        <FIELD refname="Microsoft.VSTS.Common.BusinessValue">
          <READONLY />
        </FIELD>
        <FIELD refname="Microsoft.VSTS.Scheduling.Effort">
          <READONLY />
        </FIELD>
      </FIELDS>
    </STATE>

本论坛 post 在某种程度上也说明了这种行为.此外,当您在工作项字段上使用EMPTY"属性时,它会从表单中消失,您难道不知道,EMPTY"是READONLY"和清空字段的组合.所以这一切都是有道理的,有点,最后.:)

This forum post speaks to the behavior somewhat as well. Also, when you use the "EMPTY" attribute on a work item field, it will disappear from the form and wouldn’t you know it, "EMPTY" is a combo of "READONLY" and emptying out the field. So it all makes sense, kinda, in the end. :)

这篇关于如何只读 TFS 工作项字段但不隐藏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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