Team System Developer Center >
Visual Studio Team System Forums
>
Team Foundation Server - Work Item Tracking
>
how to work with When Condition?
how to work with When Condition?
- Hi there
1- Is is possible to assign more than one vlaue in VALUE for WHEN?
2- I want to set condition for WI in following order:
If Product A selected in Product Field then set Allow and Suggested Value to GlobalList -> Component A
If Product B selected in Product Field then set Allow and Suggested Value to GlobalList -> Component B
Else set Alow and Suggested Value to GlobalList -> Components
I made first and second step but I can not set the else condition to see correct behavior...
Any Idea?
<FieldReference refname="System.Common.Component"> <WHEN field="System.Common.Product" value="Product A"> <ALLOWEDVALUES> <GLOBALLIST name="Component A" /> </ALLOWEDVALUES> <SUGGESTEDVALUES> <GLOBALLIST name="Component A" /> </SUGGESTEDVALUES> </WHEN> <WHEN field="System.Common.Product" value="Product B"> <SUGGESTEDVALUES> <GLOBALLIST name="Component B" /> </SUGGESTEDVALUES> <ALLOWEDVALUES> <GLOBALLIST name="Component B" /> </ALLOWEDVALUES> </WHEN> </FieldReference>
Answers
- That's correct. This is because when you select Product A, TFS will select the items which are both inside list Component A and Components. However, there is no one duplicate so the list shows empty. The same as Product B.
When you select other product, TFS will only use Components list.
I am sorry that we have no workaround for this issue right now. The only wayis to specify all the Products in the WHEN condition.
Hongye Sun [MSFT]
MSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg @ microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.- Marked As Answer byHongye SunMSFT, ModeratorMonday, November 09, 2009 6:10 AM
All Replies
- I'm thinking the ELSE condition can be handed by defining that ALLOWEDVALUES rule outside of a WHEN clause. Then the ALLOWVALUES stays set to Globallist->Components, unless a WHEN clause takes over.
Team Foundation Server Hi Gregg
Thank you for Replay
Actually I did as you suggest at first, The problem is that SUGGESTEDVALUES is working as expected, but after I add ALLOWVALUES just Else condition works.
No Matter what I do ALLOWVALUES does not works.
Any Idea?<FieldReference refname="Querix.Common.Component"> <WHEN field="Querix.Common.Product" value="Product A"> <ALLOWEDVALUES> <GLOBALLIST name="Component A" /> </ALLOWEDVALUES> <SUGGESTEDVALUES> <GLOBALLIST name="Component A" /> </SUGGESTEDVALUES> </WHEN> <WHEN field="Querix.Common.Product" value="Product B"> <SUGGESTEDVALUES> <GLOBALLIST name="Component B" /> </SUGGESTEDVALUES> <ALLOWEDVALUES> <GLOBALLIST name="Component B" /> </ALLOWEDVALUES> </WHEN> <SUGGESTEDVALUES> <GLOBALLIST name="Components" /> </SUGGESTEDVALUES> <ALLOWEDVALUES> <GLOBALLIST name="Components" /> </ALLOWEDVALUES> </FieldReference>
- Maybe I am wrong. I don't think this can work.
The logic in your sample code is when select Product A, Allowed and Suggested items are items which are in both global list Component A and Components. This is an AND logic I think.
The only way I can think of is to specify all the Products in the WHEN condition.
Hongye Sun [MSFT]
MSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg @ microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us. In My Example When I select Product A or Product B, the component field shows empty list. But for other products i see list of Components.
- That's correct. This is because when you select Product A, TFS will select the items which are both inside list Component A and Components. However, there is no one duplicate so the list shows empty. The same as Product B.
When you select other product, TFS will only use Components list.
I am sorry that we have no workaround for this issue right now. The only wayis to specify all the Products in the WHEN condition.
Hongye Sun [MSFT]
MSDN Subscriber Support in Forum
If you have any feedback on our support, please contact msdnmg @ microsoft.com
Please remember to mark the replies as answers if they help and unmark them if they provide no help.
Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.- Marked As Answer byHongye SunMSFT, ModeratorMonday, November 09, 2009 6:10 AM


