Unanswered How to transition from one state to another with specific field value check

  • Wednesday, August 31, 2011 8:49 AM
     
     

    I would like to do some pre checks on the particular field value before moving to another state. I have Field called sub-status which need have particular value before it move to new state. How do I do this precheck or conditional transition of a workitem ?

    Please give some ideas on this and is appreciated

     

All Replies

  • Wednesday, August 31, 2011 4:33 PM
     
     

    Hi Vinay,

    You can use the Work item Field rules. But in your scenario you are mentioning the particular value which i doubt. You can make that field as required (using REQUIRED rule) or you can assign a new value (Using COPY rule). If possible could you please explain me the scenario in detail.

    Best regards,

    Chandra

     


    Chanduvsc - MSFT
  • Thursday, September 01, 2011 8:44 AM
     
     

    You have to make your substate required and work with the WHEN and ALLOWEDVALUES rules.

    See http://msdn.microsoft.com/en-us/library/ms194966.aspx for more information


    Please remember to mark the replies as answers if they help.
  • Friday, September 02, 2011 6:31 AM
     
     

    Thanks Chandra,

    To explain bit more, I have states from New->Open->Dev->QA->Closed. Also I have substate mapped to each main state. For Example 'New' state has mapped to two sub state called 'In Analysis' and 'Reviewed'. I would like to allow next state (i.e Open) only when main state has substate 'Reviewed' (New, Reviewed).

    Vinay 

     

  • Friday, September 02, 2011 6:36 AM
     
     

    Thanks Ewald,

    I have already done REQUIRED, WHEN ALLOWEDVALUES. I am able to map substate depending on the main state. But, I would like to do is allow next state only during perticuler main and substate combination.

     

    Vinay

     

  • Friday, September 02, 2011 9:16 PM
     
     

    Hi Vinay,

    You can use the below code snippet to achieve your scenario.

    <FIELD name="State" refname="System.State" type="String" reportable="dimension">
            <WHEN value="In Analysis" field="Custom.substate">
              <READONLY />
            </WHEN>
    </FIELD>

     I made the system.state "readonly" when the "custom.substate" value is "In Analysis". This will not allow the users to change the state of the work item when the Custom.substate is "In Analysis". You can change the state when the value is "Reviewed". I hope this will help you in achieving your scenario.

    Best regards,

    Chandra


    Chanduvsc - MSFT
    • Marked As Answer by Vinay Bandakka Monday, September 05, 2011 5:10 AM
    • Unmarked As Answer by Vinay Bandakka Thursday, September 08, 2011 6:37 AM
    •  
  • Monday, September 05, 2011 5:12 AM
     
     

    Hi Chandra,

    Thanks you very much. It worked to achiev my scenario.

    Vinay

  • Thursday, September 08, 2011 6:46 AM
     
     

    Hi Chandra,

    I found a problem when I change the state and Substate. It makes State READONLY but I am not able to save. Message shows "The Value for the Field 'State' is must be the same as the original value". It expects the previous state value. So, I am not able to move to new state.

    Vinay

  • Tuesday, September 13, 2011 5:08 PM
     
     

    Hi Vinay,

    For System.state a rule REQUIRED is applied by default. Let me check once and will give you the update.

    Best Regards,

    Chandra


    Chanduvsc - MSFT