A while ago, i was asked a simple question. How can we restrict work item creation based on a user role. For example on MSF CMMI template, only testers can create Scenario Work Items.
To my knowledge there was no straightforward way to do it, but i though of a way to do it.
- Create (or use an existing one) mandatory field, and then place a restriction that the field is readonly for certain roles.
- On the workflow definition, create a restriction saying that only permitted roles are allowed to transition to a given state. In this case the given state would be the initial state (Active normally).
Technique number one, is not possible. since it is contradiction to have a field mandatory and read only (even if conditional)
Technique number two, can be achieved with the following XML, (placed on the TRANSICTIONS element, inside the the WORKFLOW element of the work item, to which you want to place the restrition)
<TRANSITION from="" to="Active" not="[global]\Team Foundation Administrators">
If you are thinking that this solution, is nothing more than a hack you are absolutely true. It is an hack, but it works. Although in a very inelegant way. If you implement this solution and try to create a "restricted" work item type you get the following error:
TF26212: Team Foundation Server could not save your changes. There may be problems with the work item type definition. Try again or contact your Team Foundation Server administrator.
No elegance at all indeed.
Does anyone know of a cleaner way to do it?
[Cross posted on http://www.agilior.pt/blogs/tiago.pascoal/archive/...]
Last week we did a four days workshop on Visual Studio Team Systems. We have collected a number of resources with some pointers to things that we either found useful, provide more formal answers to the questions that we have been asked or that give some pointers in solving some pains the client needeed to address.
I've decided to share this links with you, perhaps they can be of use to someone else too. :-)
Team Foundation Server FAQ
VSTS Resources - A huge list of VSTS Resources. Lots of information
VSTS Rocks - Visual Studio Team Systems Community Site.
Configuring Team Foundation Server to use an external Sharepoint - If you need to configure TFS to use an external sharepoint. This is not recommended for now, but if you if really have to, this is how to do it.
Visual Studio 2005 SP1 - freshly released VS SP1. Includes Team Suite, Foundation Server and Express editions.
How to integrate with external systems. For me, the eventing system is the subsystems which i like the most.
Subscribing to TFS Events - How you can subscribe to events (includes the list of available events. The list is very useful, i don't understand i the table tbl_events doesn't contain the full list of events we can subscribe to.)
TFS Notification Web Services - Visual Studio 2005 Project Template - VS template project, that will give a head start in implementing the contracts for receiving TFS notifications. The templates implements all contracts for the out of the box TFS events. No need to muck with XML, these templates will nicely deserialize the event data into (almost) nice objects. (not a problem with the template, but with the XSD provided by TFS).
How to Retrieve all event subscriptions - Code to overcome the inability of bisubscribe to list all subscribed events. Personally i find it is much easier to just query the table tbl_Subscriptions on the integration database directly.
Team Foundation Server Event Subscriber - GUI for bisubscribe. Haven't tested. Don't know if it supports subscriptions listing.
Work Item Tracking RSS Feed - A sample to generate RSS feeds for Work Items.
Project Server Integration - TFS provides a (rather limited,eg no precessors support for now) integration with Project. I hear a lot of requests for integration with Project Server. Personally we are proponents of more Agile methods, but if Project is your kind of thing, this seems like a solution. Although a not simple one, never tried, but i've skimmed the 184 pages of the whitepaper and it does seem like a big beast to tame. :-)
Web Forms for Submitting Issues to Team Foundation Server - A complain i hear often, is the lack of a web interface for the work item. If you don't want to resort to a full blown solution like TeamPlain, you can use this sample as a base for your web solution to work items.
Checkin Policies Overview - A post with an overview of checkin policies.
Jim Presto Blog - This blog has a trilogy of posts about creating your own checkin policies. It should give you a headstart. (no recent activity though)
checkin policy to disallow certain patterns - Sample of a custom checkin policy to disallow checkin of files whose name match a regexp.
Time that task - Time that task, is a custom checkin policy, that will help you keep track of how much has already been spent on a give task.
Version 4.1 of MSF project Templates - An update for the MSF templates that are included in TFS out of the box.
Scrum for Team Systems - Free template provided by Conchango, that allows you to use scrum in TFS. We have been using it, since the betas with good results. Although we feel some extra reports would be nice. :-) Scrum guidance, has been written by Ken Schwaber of agile software development hall of fame.
VSTS Customization toolkit - People who have already done some customizations to process template, now how labour intensive that is. Everything is done directly on the XML file. This this tool, simplifies this process A LOT. It totally rocks. Not only allows you to easily customize project templates, as will allow you to customize global lists (Glexport.exe/Glimport.exe), and work items (witimport.ext/witexport.exe) using the same easy process. This tool will allow prevent major hair loss (by pulling :-)).
VSTS Work Item Type Designer Preview - An experimental tool (current version doesn't save files yet), to allow you to customize work items definitions. A nice approach, instead of using a rich client to customize the definitions, it uses DSL tools to do it. I think in the future, this may provide a nice showcase for DSL tools.
How to use custom controls in Work Items - SP1 introduced a new feature, that allows you to use custom controls in work items (not only visual elements, but with business logic also). This projects aims to implement some useful custom controls so.
Managing work for Team System - Jeff Beehler gives us a nice description, of the kinds of work items that his team uses for Team Systems development (Orcas release)
[cross posted on http://www.agilior.pt/blogs/tiago.pascoal/default.aspx]