none
Modifying Requirements Work Item Type.

    Question

  • Hi Folks,

    I am just trying to implement the following scenario for the Requirement Work Item type (CMMI template).  Just wondering if anyone has done this before and can offer any pointers - it is just a standard "Choose the team, then choose the team-member" workflow.

    I have added a new field to the work item called "Assigned Team" just above the "Assigned To" field.  It contains 3 values  "None", "Business Analysts", "Developers" with the default value for both when the work item is created being "None".

    The "Assigned To" field only contains the "None" value when the Work Item type is created.  State is set to pending.

    Initially the user will need to fill in the work item, select the Assigned Team value (other than none) and save the requirement.  The requirement cannot be saved until a team is assigned. State can only be pending.

    When the work item is opened again for triage, I would like to load the "Assigned To" field with members of the team that was selected in the previous stage.  Something like IF "AsseignedTeam" == "Developers" THEN  AssignedTo Contains "[Project]/Developers".   A developer can be selected from the list, state can be changed to accepted and the work item can be saved.   If the AssignedTo value contains "NONE" and state is not set at pending, the work item cannot be saved.

    If the team is changed at a later date and the state is not pending, it would probably be a good idea to request a new team member be assigned before allowing the modification to be saved.

    I am familiar with changing the rules on a work item, but have not yet gotten a handle on working with transitions which is what I suspect I need to do.

    Regards

    Andy

    Friday, March 08, 2013 1:01 AM

Answers

  • Hi Andy, 

    Thanks for your reply.

    As far as I know we can load TeamControl field with DevTeam members when fieldX.value==’Dev Team’, or can load TeamControl field with DevTeam members when State==’accepted’. But the work item field default rules not support when fieldX.value == ‘Dev Team’ and State ==’accepted’. 

    <FieldDefinition refname="TeamControl" name=" TeamControl " type="String">

      <WHEN field="fieldX" value="Dev Team">

        <ALLOWEDVALUES filteritems="excludegroups">

          <LISTITEM value="Value1  " />

          <LISTITEM value="Value2" />

          <LISTITEM value="Value3" />

                    … … 

        </ALLOWEDVALUES>

      </WHEN>

    </FieldDefinition>


    John Qiao [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by AndyW2007 Tuesday, March 19, 2013 8:11 PM
    Tuesday, March 19, 2013 6:55 AM
    Moderator
  • I solved the issue eventually by splitting the logic across two states (proposed and accepted) and using the WHEN condition.

    On the first state when the requirement is new, I set the AssignedTO value to NONE.  After the work item is saved, an admin can change the state to accepted.  On the accepted state I use the WHEN AssignedTeam = "dev teams name"  AssignedTo gets loaded with the team members (the list item value is [project]/dev team]).

    I didn't need to use the AND because the state can only be 'accepted' at this stage. 

    Tuesday, March 19, 2013 8:10 PM

All replies

  • Hi Andy, 

    Thanks for your post.

    What’s the version of your TFS?

    Which State values you want to setting in Requirement Work Items? The ‘pending’ value is not support for default State field in Requirement Work Item.   

    We can setting field rules in Workflow Transition dialog. How to use TFS Power Tools to new field and edit Work Item Type workflow, please refer to: http://tedgustaf.com/en/blog/2011/1/how-to-customize-tfs-2010-work-items-and-workflows/.    


    John Qiao [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.



    Monday, March 11, 2013 9:49 AM
    Moderator
  • Hi John,

    Thanks for your reply, the article helped. 

    I am using TFS 2012/VS2012

    The only part I am now trying to work out is how to load a set of values into a custom field, based on a value in another field.  For example, if a requirement gets assigned to a team, I want to load a team members custom field with the members of the selected team.

    So something like IIF fieldX.value == 'Dev Team' and State == 'accepted' THEN Load  TeamControl with DevTeam members.

    Regards

    Andy


    • Edited by AndyW2007 Monday, March 18, 2013 10:18 PM
    Monday, March 18, 2013 10:03 PM
  • Hi Andy, 

    Thanks for your reply.

    As far as I know we can load TeamControl field with DevTeam members when fieldX.value==’Dev Team’, or can load TeamControl field with DevTeam members when State==’accepted’. But the work item field default rules not support when fieldX.value == ‘Dev Team’ and State ==’accepted’. 

    <FieldDefinition refname="TeamControl" name=" TeamControl " type="String">

      <WHEN field="fieldX" value="Dev Team">

        <ALLOWEDVALUES filteritems="excludegroups">

          <LISTITEM value="Value1  " />

          <LISTITEM value="Value2" />

          <LISTITEM value="Value3" />

                    … … 

        </ALLOWEDVALUES>

      </WHEN>

    </FieldDefinition>


    John Qiao [MSFT]
    MSDN Community Support | Feedback to us
    Develop and promote your apps in Windows Store
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by AndyW2007 Tuesday, March 19, 2013 8:11 PM
    Tuesday, March 19, 2013 6:55 AM
    Moderator
  • I solved the issue eventually by splitting the logic across two states (proposed and accepted) and using the WHEN condition.

    On the first state when the requirement is new, I set the AssignedTO value to NONE.  After the work item is saved, an admin can change the state to accepted.  On the accepted state I use the WHEN AssignedTeam = "dev teams name"  AssignedTo gets loaded with the team members (the list item value is [project]/dev team]).

    I didn't need to use the AND because the state can only be 'accepted' at this stage. 

    Tuesday, March 19, 2013 8:10 PM