TFS 中的工作项状态更改规则 - 是否可以使用“AND”或“OR”?
我的工作项中有此状态,只有在填写其他四个字段(日期)之一时才能设置该状态。无论四项中的哪一项,只要至少填满一项即可设置状态。
示例:
此场景允许您更改工作项状态:
DateA 01/05/2012
DateB '
DateC '
DateD '
这也是:
DateA '
DateB 01/05/2012
DateC 01/05/2012
DateD '
这不是:
DateA '
DateB '
DateC '
DateD '
我想过使用 WHEN
,但它不起作用,因为我可以不要写“当这个和当那个”
有什么建议吗?
编辑:另外,我不能对 System.State 使用规则“PROHIBITEDVALUES”,所以我相信任何方法都是无用的。
编辑:我相信(但不触及核心领域)唯一可以做到这一点的方法是 n WHEN
和 n WHENNOT
,其中n 是日期字段计数。然后,借助两个全局列表(一个是虚拟列表,一个是禁止值),也许可以锁定每个缺失日期的字段,然后解锁每个未缺失的日期(从而满足这一场景)。无论如何,这在我的情况下不起作用,因为错误TF26062:“System.State”字段不支持规则“insert-rule-here”。
解决方案:我接受 Gregg Boer 的答案,因为你不能真的将条件子句“AND”在一起
。但我的解决方案本身是将一个事件附加到事件订阅工具,每当某些用户在不填写日期的情况下更改状态时,我都会将状态设置回来。然后他收到一封电子邮件,解释他的更改被拒绝的原因。这不是理想的解决方案,但我想不出其他的办法。
I have this state in a work item that can only be set if one of four other fields (dates) are filled in. It doesn't matter which one of the four, if at least one is filled then the state can be set.
Example:
This scenario lets you change the work item state:
DateA 01/05/2012
DateB '
DateC '
DateD '
This one too:
DateA '
DateB 01/05/2012
DateC 01/05/2012
DateD '
This one doesnt:
DateA '
DateB '
DateC '
DateD '
I thought of using WHEN
, but it won't work, as I can't write "WHEN this AND WHEN that"
Any suggestions?
EDIT: Plus, I can't use the rule "PROHIBITEDVALUES" for System.State, so any approach will be useless, I believe.
EDIT: The only way one could do that, I believe (but without touching core fields) would be n WHEN
s and n WHENNOT
s where n is the date fields count. Then, with the aid of two globallists (one dummy, and one with the prohibited values) maybe one could lock the field for every date missing, and then unlock for every date not missing (and thus fulfilling this scenario). Anyway, this can't work in my case because of error TF26062: Rule 'insert-rule-here' is not supported for the field 'System.State'.
RESOLUTION: I'm taking Gregg Boer's answer because you can't really can't "AND" together conditional clauses
. But my solution itself was to attach an event to the event subscription tool where I set the state back whenever some user changes it without filling a date. Then he receives an e-mail explaining why his change was denied. Not the ideal solution, but I can't think of anything else.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
抱歉,TFS 工作项规则无法满足您的要求。您不能像上面的示例中那样将条件子句“AND”在一起。
I am sorry, but there is no way to do what you are asking with TFS work item rules. You can't "AND" together conditional clauses like you need to in the example above.