Wednesday, October 31, 2012

TFS2012–multiple users assignment – tfs user group

I think the most well known classical workaround like in TFS2008 and TFS 2010 is to assign a work item to a group of people.

How to do it?

  • You have to create for each combination of persons you want to be able to assign a user group in TFS
  • You have to adapt each work item which should support this by adding these groups to the assigned to field as allowed values.

Assume that you are working in a team with 5 persons and want to be able to assign your work items to the following combinations.

  • Group: Team
  • Group: PersonAPersonB (Person A, Person B)
  • Group: PersonAPersonC (Person A, Person C)
  • and so on ….

You have to create for each combination a new group in TFS and assign the persons to it.

You have to adapt your work items and change the definition of your Assigned To field to something like this:

<FIELD name="Assigned To" refname="System.AssignedTo" type="String" syncnamechanges="true" reportable="dimension">
<
ALLOWEDVALUES expanditems="true">
<
LISTITEM value="[project]\PersonAPersonB" />
<
LISTITEM value="[project]\Team" />
<
LISTITEM value="[project]\PersonAPersonC" />
</
ALLOWEDVALUES>
</
FIELD>



And in webaccess it will look like this (test is the only user in this screenshot and is assigned to the team group):


Task work item with groups in assigned to field


 


Limitations?


One of the most interesting question is how it will integrate with the new agile features in TFS2012.


General issues and workarounds:



  • Custom work item queries have to be adapted to also work with groups
  • Hardcoded work item queries are not working with groups like “My Work in Team Explorer“


Taskboard


For the taskboard it doesn’t make a difference if a work item is assigned to a user or a tfs user group.


agile taskboard with group assigment


agile taskboard with person filtering


Capacity planning Calculation is broken!


As we can see in the screenshot below the capacity planning calculation does not work together with the group assignments.


image


image


 


Conclusion


For special use cases this can be a valid approach with the downside that you cannot use the new capacity planning features. Each work item query which relies on the @me keyword has to be adapted for each team member to include the custom groups. This means that we won’t be able to have a generic query like “Assigned to me” anymore.

8 comments:

  1. Hello!
    I use TFS 2012. I added TFS Group and modified Task and Bug. Why users are not notified when I assign work item to them? (Notification type "soft: A work item is assigned to me" is set for all members of the TFS Group).

    ReplyDelete
  2. Because TFS does not support multi user assigment by default and this is a not supported scenario.
    You have to workaround it with a custom alert rule like
    - 'if System.AssignedTo == groupname then send mail to x'
    - here x can be a mailing list for the team
    Hope this helps.

    ReplyDelete
  3. Thanks! Exactly where (in which file or XML), I can add (or edit) this custom alert rule?

    ReplyDelete
    Replies
    1. Check custom alerts like here: http://i.msdn.microsoft.com/dynimg/IC660383.png
      Details: http://msdn.microsoft.com/en-us/library/vstudio/ms181334.aspx

      Delete
  4. Hi!
    I want to ask a question about tfs workitem user permission. I have two team(developer, tester).
    Tester :
    1. Create work item
    2. İf AssignedTo = tester(web access user @Me), change or edit some fields.
    3. İf AssignedTo value is another person; tester can not change work item fields
    4. İf State = proposed and createdby = @me then change work item
    5. İf state = resolved and assignedTo = @me then edit workitems some fields.

    Developer :
    1. İf Assignedto = developer(Web access user @Me or currentuser) change or edit somefields.
    2. İf AssignedTo value is another person; developer can not change work item fields

    For example : I login web access with TFSTest user. I change title field. But developer user only see this field not edit.
    How can add rule to fields AssignedTo. I try to add rule title Assignedto = currentuser or AssignedTo @Me, It doesn’t work. Can you help me about this situation.

    ReplyDelete
    Replies
    1. If I understood right, please check the following link.
      There you’ll find how to change fields with state transactions.
      http://msdn.microsoft.com/en-us/library/vstudio/ms400654.aspx
      There is a second option that you can define a default value for your field like the following sample
      http://stackoverflow.com/questions/3871495/tfs-custom-workitemtype-set-field-to-current-user

      Delete
  5. Hi Daniel!

    Can i use multiple WHEN conditions in WITD? Is it possible to multiple conditions in single WHEN statement because i need to populate a field based on the two field values.

    My scenario is like this :

    I need to populate the field 'Priority' based on the values of 'Severity' && 'Likelihood' in TFS using WHEN condition in WITD.

    Help me out about this situation.

    ReplyDelete
    Replies
    1. You cannot have a single WHEN statement with multiple conditions, as far as I know it's not supported yet.
      You can workaround it like described here: https://social.msdn.microsoft.com/Forums/vstudio/en-US/ae16504e-36e3-428c-b8a4-21639b44526d/when-rule-within-a-when-rule?forum=tfsworkitemtracking
      Another approach would be to develop a custom extension which hocks on WIT Events.

      Delete