Proposed Answer Work item - required field on transition

  • 10. ledna 2012 21:08
     
      Obsahuje kód

    Hi,

    I want a specific field to become required when work item state = Resolved and Reason = Fixed.

    I used:

    <FIELD name="Root Cause" refname="Microsoft.VSTS.CMMI.RootCause" type="String">        
    
            <WHEN value="Fixed" field="System.Reason">
    
              <REQUIRED />
    
            </WHEN>
    
    </FIELD>
    


    However, when i change field state to resolved and reason is by default fixed, the root cause is not changed to required.

    Only after I change the reason to a different reason and back to fixed, the root cause is set to required.

    Does anyone know how to solve this issue?

    Thanks,

Všechny reakce

  • 10. ledna 2012 23:33
     
     Navržená odpověď

    Hi Billy,

    Try move/add this rule on State Transition for Resolved state.

    Let me know if you need more info

    Regards,
    Adhi

    http://my2centsontfs.blogspot.com

    • Navržen jako odpověď Adhithan 10. ledna 2012 23:34
    •  
  • 11. ledna 2012 6:28
     
     

    Hi Adhi,

    Thanks you for your answer.

    If I add the rule to the state transition, the root cause is required for all reasons.

    I want it to be required only for state resolved and reason fixed.

    It it possible?

     

    thanks,

  • 7. února 2012 6:14
    Moderátor
     
     

    Billy,

    Rules like WHEN clause in Workitem xml is evaluated with logic, the details like below. The rule is applied when user moves focus from that editing field, item 8. Would you check it?

    I'm referring to:

    1. Using the Visual Studio user interface, the user creates a new work item or edits an existing work item.
    2. Fill in field defaults. For all fields, use any <DEFAULT> rules that are outside <WHEN*> rules.
    3. Copy field values. For all fields, use any <COPY> rules that are outside <WHEN*> clauses.
    4. For all fields with a <WHEN> rule that matches, first do <DEFAULT> and then <COPY> rules inside.
    5. For all fields with a <WHENNOT> rule that matches, first do <DEFAULT> and then <COPY> rules inside.
    6. For all fields that have had their values changed since step 1 and that contain <WHENCHANGED> rules, first do <DEFAULT> and then <COPY> rules inside.
    7. Allow the user to start editing.
    8. The user changes a field value and then moves focus from the field.
    9. Raise any <WHEN> rules for that field that match the new value.
    10. Raise any <WHENNOT> rules for that field that match the new value.
    11. Raise any <WHENCHANGED> rules for that field that match the new value.
    12. Return editing ability to the user.
    13. The user saves the changes to the database.
    14. For all fields, perform <SERVERDEFAULT> operations that are defined for the field either directly or indirectly under a <WHEN> or a <WHENNOT> rule

    Forrest Guo | MSDN Community Support | Feedback to us