TFS 2012 hide content of work item field based on rights - tfs

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

Related

TFS2013 Web Access - Configuration for Stakeholders

We use TFS2013 on premise. A request came up that when using Web Access, some members with Stakeholder access should only have limited rights when opening work items.
They should be able to edit Description, Acceptance Criteria, etc fields, but others should be read-only, such as Iteration, State, etc.
The only option I saw was about tags Create tag definition option under
Security >> Permissions, but that's not enough for me.
One idea was Customizing a process template, but this seems to be thin ice as our team doesn't have any experience with it and the things to avoid list is quite long.
The best workaround approach so far is to reference the TFS ClientLibrary from Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\ReferenceAssemblies\v2.0\ and create a custom website which implements only the required features (for example when opening a work item, State would be a Label instead of a DropDownList).
The drawback of this solution is that it would keep the whole WebAccess portal hidden, including its nice features.
So my question in short: is there a way to make certain fields read-only on the work item form for stakeholder members?
UPDATE
Eventually I went towards Template Customization using TFS Power Tools 2013. Now I have to following problem:
Applying rules for certain fields work just fine, but in case the field type is TreePath, saving the template gives the following error
TF26062: Rule '< READONLY for="[Global]\Stakeholders" />' is not
supported for the field 'System.AreaPath'.
There were validation errors. Continuing to save may cause the file to
become unloadable, do you want to continue?
According to this answer from 2009: "there are some particular fields which can't be applied rules for"
Any suggestions how to go on?
You can choose the work item types to make some fields read only.
You will never need to be careful to not mark field read only that are needed for adding items. That would include area and iteration. Use witadmin.exe to export the desired work item and add read only clauses only for those in the stakeholder group.
You would be better with a permissive model. Allow everything and tell them what bout to change. Then have an alert for changes to those fields by stakeholders.

Can TFS 2013 have email notications to multiple users that watch a work item

I'm looking to reproduce the Jira watch functionality in TFS 2013. In Jira, you can click a link to watch an item and thereafter you will be notified when anything on that item changes.
I know on TFS you can:
be emailed if anyone changes a bug you are assigned to
manually email a bug to anyone at any time
Create a custom report and pin it to your home page to notify yourself of things (like this maybe?)
I can imagine creating a new field that will accept multiple users and creating a custom email notification to notify everyone in that list if the work item changes. But that seem like a whole lot of work and I'm not sure were to start if that is the way do do this.
What's the easiest way to get functionality like watching a work item? If it's easy and similar to the Jira functionality that is better for me than exactly the same and hard to do.
Sure, you can setup email alerts based on many different criteria, including what you asked for.
You need to go to the Alerts section, and create a new custom alert, and you can put in the ID of whatever work item you want to "watch". By default it includes the clause AuthorizedAs <> [Me] which will make sure it doesn't email you for changes that you make, but you can remove that clause if you'd like.

Create a UNIQUE rule over custom field in WorkItem

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.

Check In Check Out Work Items in TFS 2010 API

Does TFS 2010 have the concept of checking out work items and checking them in. This action would lock the item for edit by other users while it is checked out.
I know I can do this for files under source control, but what about regular work items?
I haven't yet come across any documentation around this. If it's possible, does someone have a code sample?
That is not possible. In TFS11 we have added 'merge on save' so there are less conflicts when saving a work item.
Would love to know why you want this feature though.
You could achieve a lock mechanism on work items if you write a custom control that allows or denies saving based on the result of some query you make to a custom service.
You would want to create a visual studio plugin that sets and resets the lock per work item.
While you're at it, you could write a server plugin that persists a serialized copy if the work item to disk or to the version control system.
I know it's a lot if work, but it should give you what you asked for.

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