Changing the scope of the AssignedTo field in TFS 2010 Work Items

This post is related to changes for Team Foundation Server 2010 but a similar process can also be followed for TFS 2008.

For so long I’ve been meaning to sort out the list of names that appear in the AssignedTo dropdown list when creating work items. This evening I’ve been making some changes to our work item Status workflow following some positive feedback from the QA team and so finally got around to fixing this.


By default it will show all of the Active Directory users that have access to the project. That unfortunately includes all of the system administrators and service accounts, TFS related or otherwise that will be imposed upon you through group policy.

What we need is the ability to restrict this list to only those people pertinent to the project. At the simplest level that would be those people within the TFS Project Contributors group. In a future post I’ll look at filtering this list further based on additional attributes of the work item. For example, subsequent to setting the status to Triaged, you may only want to assign to members of the development team. For now let’s keep it simple.

I’m going to assume you’re comfortable with the TFS Power Tools (available as an Extension in VS 2010) as it’s through the Process Editor available in this extension that we’ll be making our change.

You have a couple of choices here. You can either edit the Work Item Template against a Process Template or as I’m doing directly for now, against the WIT for an existing project.


Select the Work Item Type from the appropriate project in the dialog that pops up and you’ll be presented with the Work Item Editor screen thus:


Double click Assigned To and select the Rules tab on the dialog


You won’t have ALLOWEDVALUES in your list. It’s the setup of this rule that filters the list of displayed names.

Click New and enter the name of the TFS group you want to restrict the list to.


In our case I’m restricting to the Contributors group for the current project. Note the highlighted [project] should be as is and not substituted for your own project name.

Close down all the dialogs and save the template (either import if you exported or just save). If you did this against an existing project go in and create a Work Item of the modified type and hopefully you’ll see a much cleaner list. If your AD is setup correctly it’ll pull in Full Name otherwise you’ll get just the login name.

I hope this is of some use and please don’t be afraid to get stuck into modifying your process templates and work items. Whilst it’s always a good idea to start with the OOB template never be afraid to modify it to suit your own needs. Especially if in our case it helps in getting some real usage out of TFS

Summary

You can restrict the names that appear in the AssignedTo list by adding an ALLOWEDVALUES rule to the attribute within the Work Item Template.

About these ads

About Darren

I’m a Software Developer from Birmingham in the UK. I work primarily with Microsoft technologies which for pretty much everyone nowadays that means .NET. I do however like to step outside the distortion field as often as possible to soak up some of the Open Source goodness. Of late this has been mainly javascript and HTML5 as I'm fascinated by the direction the web will be taking over the next few years with the onslaught of the mobile platforms. Finally the world is catching up. If only more people had enjoyed the goodness that was the HP TC1100 so many years back! Most of my development is done in C# producing bespoke business applications. For the last five years this was for an IT services company but I’m now working in the IT department on some exciting work for a large UK institution. I’m not going to name them here as although the majority of this blog will be about the projects I’m working on and the knowledge I gain (and mistakes I make!) with them they are entirely my own opinions.
This entry was posted in Uncategorized. Bookmark the permalink.

2 Responses to Changing the scope of the AssignedTo field in TFS 2010 Work Items

  1. Nicolas Lope de Barrios says:

    Awesome tip, worked as expected in TFS 2010. Thank you!

  2. Nicolas Lope de Barrios says:

    Now, the next challenge is how to do this for every new/existing project using the Scrum 1.0 (for example) template, without editing one WIT at a time.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Connecting to %s