none
State transition based on the attribute of a value

    Question

  • We have customized the TFS template with respect to our requirements. we are modifying the already existing work item (example: Bug).

    We need to modify the workflow of work-item (ex: Bug) according to the following condition:

    "Transition from one state to another (example 'Resolved' to 'Closed') only if selected value from a dropdown filed (ex: Priority) is ‘High’(Value present in dropdown field)".

    We are able to modify the workflow, but facing problem while applying the above mentioned condition.

    Is there a way to modify the workflow according the above mentioned condition?


    Basavaraj C. Wadi

    Wednesday, July 18, 2012 2:13 PM

Answers

  • Hi Wadi, 

    Thanks for your reply. 

    Sorry for any inconvenience, as far as I know there’s no default way to set a “rule” for the Transition(from one state to another) to achieve that ”It should not allow the user to select to the next STATE, if the selected field value is not the expected value”.


    John Qiao [MSFT]
    MSDN Community Support | Feedback to us

    Friday, July 20, 2012 5:56 AM
    Moderator

All replies

  • Hi Wadi, 

    Thanks for your reply.

    Please try the following steps:

    1        Open your bug work item type using TFS Power Tools.

    2        Under Workflow tab, right-click the Transition(from Proposed to Closed) and click Open Details.

    3        Under Fields tab, click New to open the Field Reference window, under Field Reference tab, selected the System.State, under Rules tab, click New to add the WHENNOT rule.

    4        In WHENNOT window, under Field Condition tab, selected your Priority field, and set Value to High. Under Rules tab, add the READONLY rule.

    The System.State xml definition defined in this Transition(from Proposed to Closed) like the blew:   

    <FieldReference refname="System.State">

      <WHENNOT field=" Priority" value="High">

        <READONLY />

      </WHENNOT>

    </FieldReference>


    John Qiao [MSFT]
    MSDN Community Support | Feedback to us

    Thursday, July 19, 2012 6:06 AM
    Moderator
  • Thanks John for your reply, but I tried this option earlier, we dont want to slect the field value based on the state change.

    My question is: "It should not allow the user to Select to the next STATE, if the selected field value is not the expected value".

    Example: I have a field called Priority with the values High, Medium & Low, and states with the names 'Active', Resolved' & 'Close'.

    My requirement is: I'll select the Priority field value as 'Low' at 'Active' state and move it to 'Resolved' state. Then, I want to move it to 'Close' state, but the condition is user should not be allowed to 'Close' state, because the Priority field value not 'High' ('Close' state should not be visible to the user if the Priority field value not 'High').

    Please let me know is any solution for this problem??


    Basavaraj C. Wadi

    Thursday, July 19, 2012 10:45 AM
  • Hi Wadi, 

    Thanks for your reply. 

    Sorry for any inconvenience, as far as I know there’s no default way to set a “rule” for the Transition(from one state to another) to achieve that ”It should not allow the user to select to the next STATE, if the selected field value is not the expected value”.


    John Qiao [MSFT]
    MSDN Community Support | Feedback to us

    Friday, July 20, 2012 5:56 AM
    Moderator