Create a UNIQUE rule over custom field in WorkItem - tfs

I'm customizing the Work Item Definition Schema for the 'task' work item in TFS Server 2012. I've created a new field for hold a CustomerReference value. It works as I expected, but I would like add a UNIQUE restriction for security. I'd like add a rule than it makes imposible create two workItems with sme CustomerReference.
I think that none of the rules defined here http://msdn.microsoft.com/en-us/library/cc339553(v=vs.90).aspx achieve my target.
Any idea? Thanks in advance,

As a last resort there is a way to write a custom plug-in that can enforce this server-side. See this link for more info on creating an ISubscriber plug-in: http://nakedalm.com/team-foundation-server-2010-event-handling-with-subscribers/
Unfortunately, the plug-in model doesn't allow you to prevent changes; but it could allow you to detect when somebody has violated the rule and react. For example, it could send an email off to somebody, and possibly clear out the CustomerReference field from the duplicate.

Related

How to import legacy requirement IDs into TFS 2013?

I am trying to import some existing requirements into TFS 2013 (currently just maintained in a Word doc). However, I need to preserve the existing, pre-assigned requirement IDs (for tracking against existing test cases outside of TFS, etc.). I've come up with multiple ways of doing it:
Keep it as part of the requirement title
Add it to the description for the requirement
Add a tag with the legacy req id to the appropriate req in TFS
Add a new field for it to the requirement template (or simply use an existing unused field)
All of these seem pretty unclean to me except the "new field" option, but I'd rather avoid changing the work item template if I could.
Are there are other/better ways to do this? Has anybody done something similar before?
I usually add a field to most of my work items called External ID that I use for this purpose. It's also useful to link TFS Work Items to say a ticket ID in a Help Desk ticketing system.

TFS 2012 Add custom Dictionary

We're about to implement TFS 2012 and I've been having some fun customizing some work items to aid us in our reporting. One issue we have is our reporting based on clients.
Our Product Backlog Items keep our requirements, however, we need to report our requirements per client (government regulations). Some requirements will affect all clients, some will only reflect certain ones. I've been able to add a global list of clients along with a multi-select option and that part is working great.
The issue is we need to also note the requirement number for each selected client. I know I can go in and add a field for each 'Client Requirement', but as that list gets bigger, that screen will be insanely huge.
Does anybody know of such a way to implement something of the sort?
One option would be to create a custom Work Item Type for Clients. Then link your PBI's to the appropriate client WI's. When you create a link you can enter a link comment also which you could use to capture the client-specific requirement number.
I would create a custom "Client Requirement" work item that has the list of clients to select and includes a field for Client ID. You can then either use the related link type or create your own, maybe "Implements \ Implemented By" so that you can create a Reporting Services report that pulls the ID's

How to automatically assign a TFS work item to a particular person/role

I would like to customize a Work Item Type in TFS to automatically set the Assignee to a particular role. For example (to compare to another Issue Tracker), in JIRA the default Assignee is the Project Lead (so that any ticket not otherwise assigned, gets automatically assigned to whatever person is designated in the role of Project Lead). Can I do something similar in TFS?
So, I realize that one difference between JIRA and TFS is that TFS doesn't (to my knowledge) have the concept of "Roles". The closest thing to that is "Groups", but unlike Roles, Groups can have multiple people (which may be the restricting factor in this problem). I know how to configure a TFS Work Item so that only a certain Group gets listed in the "Assign To" field, but I would like to go a step farther, if possible, and create a custom Group with just one member (e.g., "Issue Guru") and then set up the work item to get automatically assigned to that person.
I'm trying to replicate the Jira functionality here, and maybe there is just no good way to do it in the TFS framework. Any suggestions?
There's a Step by Step Guide on Ivan Fioravanti's Blog for enabling it.
If you are unfamiliar with customising Work Item Types, have a look at the following links (stolen from Grant Holliday's blog).
I never tried this in production but here is something I tried quickly and it seems like it could work.
You can set the default value to a Group by editing work item template in template editor.
Just select Assigned to field and add a DEFAULT rule like shown in the image below.
This will also require you to create one or more groups (one global or maybe one per project). Once you set this up you won’t have to make any updates in the future but only manage people who are in the groups.

TFS 2012 hide content of work item field based on rights

is there a way to hide the content of a field based on a role?
I thought about creating a serverside plugin which empties the field if the user does not have permission to view the field and repopulate it on save. But I don't know how to do this, I did not find any event which I could use. Any idea?
My first intent was to use the EMPTY rule but this really clears the content and does not repopulate it. Also the READONLY rule is not acceptable for us. Do you have any idea?
I know this was already requested http://visualstudio.uservoice.com/forums/121579-visual-studio/suggestions/2088177-add-ability-to-hide-mask-fields-in-a-work-item-bas but I need the functionality now.
I also thought about creating a workitem where the hidden fields are stored in and linking it to the other work item but this is not the solution I want ...
The only way to do this is by creating a custom work item control. That control can then only display the contents of the value if the user has the correct permissions. What it does not prevent though is to see/update the data via other tools like Excel, Work Item Query or Bulk Update.
As the suggestion on User Voice suggests, it is not possible today in TFS. So please vote and make sure the Team Foundation Server team knows it is high priority for a lot of our customers.
Ewald Hofman (Program Manager, Team Foundation Server)
In VS 2013 when u use the Empty Rule, the field disappear! You can see that in Scrum Template when you change de WIT state to Done the Remaining Work field are hidden

How can I hide a work item field from some users in TFS 2008?

I'm customizing work item templates in TFS 2008 through the PowerTools and I'm wondering is it possible to hide a field (or it's value) for certain users?
For example, let's say I open TFS to my clients so they can submit feature requests. I'd like them to see the work item created, to see the history, changes etc. but I'd like to keep some of the field private and for our internal use.
Is it possible?
Hm, it seems it is not possible YET.
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=254161
"This is a great suggestion. We have added it as a candidate for a future release. It would help us if you could provide a business case for this request. Thanks."
Another option would be to create a custom interface to the work items that only exposes the fields you want, while hiding others. While it would mean some custom development, it would solve the problem.
You can make it readonly - that's close? Good luck.
You can use the rule.

Resources