Usernames in TFS

Hi!

I have a question about the usernames (fullnames) in TFS.

As TFS displays now, it displays the fullname of the user loginname in userrelated fields (like Assigned To). So if you have a user DOMAIN\User1 (With the full name FirstName LastName), it will display FirstName LastName in these fields.

The problem is that if DOMAIN\User1 changes name to FirstName emaNtsaL on the domain, the userrelated fields still displays FirstName LastName! After some digging I found out that the fullname for the user account is stored in the table Constant, but it's not updated whenever the domain is.. Why's this

The reason why I discovered this problem was that I am developing a lightweight webpart that should handle some WorkItemTracking, and one of the things this should do is to filter on Assigned To field (using WIQL). But since this field is taking in the fullname only and not the username, it's impossible to do a search to get out DOMAIN\User1's items since the domain fullname and tfs fullname is different!

A another problem with this that the filter is only possible on the full name , is that if two users has the same full name (which I find quite common), how is it possible to distinguish between these two using WIQL

So my question is twofolded:
- Why is the fullname stored in TFS and does this change automatically or possible to change manually
- Is there any way to use DOMAIN\User1 to search on in WIQL instead of fullname @Me works, so it should be possible...

--Rune



Answer this question

Usernames in TFS

  • Chris Dunaway

    Ok...

    I feel that the name handling is a severe limitation of TFS.. Not only a limitation, but a serious design flaw that would impact companies in places where it is common that several people has the same name (here in Sweden this is quite common). And I can't see that fullname would be better in larger companies than usernames in these scenarios. And personally I would see it better that the fullname was taken out of the AD instead of duplicated into TFS, then there would be a decent chance to sort it out...

    It is impossible to take out reports based on users then where duplicate fullname exists.

    But isn't it possible to change a users name when the user is added already to TFS (For example, a person has been married/divorced). If not, that would also be a severe limitation that a user maybe after two years has an invalid name in TFS Of course is it possible to go directly into the table to change, but I doubt it is legal from MS point of view.

    As for WIQL, I have just begun looking into it.. It's not that much documentation about developing against TeamFoundationServer, so that takes time to work against too...


  • JohnDB

    Rune,

    The tool is a re-active fix to the problem. We have considered making it a power tool, but it doesn't seem like it's really in the category of power tools. We are considering, in future versions, having a proper server side fix that automatically updates the work item tracking DB when a user's name changes in AD.

    We'll see how many folks need this and we may re-evaluate our decision on whether this should be released as a power tool.

    Tomas - to answer your question. If you use allowedvalues rule, this WILL automatically pick up any display name changes made in AD, and this will be reflected in the drop-downs. However the problem is that the data stored in the work item instances is just a string (and in the case the old display name), and does not reference a SID.

    Hope this helps,



  • Michael Pritchard

    Thanks for your answer!

    Please consider adding that tool to standard TFS in next SP or next release of TFS.. Or maybe as an automatic job each time a user authenticates against TFS (some way) It will probarly come in handy for several companies! =)


  • Ravi Santha

    TFS copies the names into the database for performance reasons. It would simply be too expensive to query Active Directory everytime you needed a person's name. Also, it is possible to have non-AD users in TFS so the names must be kept in that case.

    It is possible to change a user's name once they have been added to TFS. We created a tool called TfsWitDisplayNames that will go through the tables and update the names specified in a mapping file. It was created for when users might get married or divorced or when a company decides to change the format for their display names (from 'Last, First' to 'First Last' for example). The tool is available by contacting CSS (customer support).

    If there are commonly people with the same name, you could consider adding something in parentheses to their display names in Active Directory so you can differentiate between them in drop down lists. For example, if there are mutliple John Smith's their display names could be John Smith (Marketing), John Smith (Cust Support), etc.


  • Hanumanth Reddy

    Moved to the Work Item Tracking forum where hopefully someone can help.

    There are a few known issues with the use of fullname in the work item tracking area. The reason why WIT uses full name for display is that many large companies have usernames that mean very little to others in the team, so the decision was taken to use full names instead - however the implementation of this has caused some issues in TFS V1.

    As far as I know, it is not possible to query on DOMAIN\username in WIQL, however it is possible to get a list of the valid usernames to use in a selection drop down - but I don't think that will allow you to tell the difference between work items associated to two different people called "John Smith" etc.

    That said, the WIT stuff is not particularly my area of expertise and many of the folks here know more than I about this topic.

    M.


  • MisterMoon

    OK, Thats fine.

    If I add the ALLOWEDVALUES like above, shouldn't that "remove" a lot of users from the list
    If not, it is possible to achieve that

    Thanks!

    /Tomas Scott


  • Usernames in TFS