TFS email notification

狂风中的少年 提交于 2019-12-04 22:46:18

In VS 2005 at least, on the Team menu you will find a Project Alerts... item which allows users to specify an email address that will be notified when My work items are changed by others, which covers both the situations you mention. I imagine VS 2008 will have a similar thing.

Unfortunately, TFS doesn't have anything built out of the box for this to be done without recipient intervention. Richard Ev comment can work, but is not really sustainable. Each person needs to create this or you need to do it for them and continue doing it for all new team members.

Instead, you're better off creating an Event Subscriber. Here's a very helpful post http://www.codeproject.com/Articles/110292/Team-Foundation-Server-2010-Event-Handling-with-Su.

You'll want to use the IIdentityManagementService to retrieve the corresponding users' email. An example:

using (var projectCollection = TfsTeamProjectCollectionFactory.GetTeamProjectCollection(collectionUri, new UICredentialsProvider()))
            {
                var gss = projectCollection.GetService<IGroupSecurityService>();
                var ims = projectCollection.GetService<IIdentityManagementService>();

                var validUsersId = ims.ReadIdentity(IdentitySearchFactor.AccountName, "Team Foundation Valid Users", MembershipQuery.Expanded, ReadIdentityOptions.IncludeReadFromSource);

                var validUsers = gss.ReadIdentities(SearchFactor.Sid, validUsersId.Members.Select(x => x.Identifier).ToArray(), QueryMembership.None);

                foreach (var member in validUsers)
                {
                    Console.WriteLine("{0}: {1}", member.AccountName, member.MailAddress);
                }
            }

In VS 2010, if you have the TFS 2010 Power Tools installed you can go to the Team menu and select Alerts Explorer. That will allow you to create new alerts.

I know your post is for 2008, but it's an old post and hopefully you're on 2010 now. For TFS 2010 there is an easy solution for you now, via a plugin which can be downloaded from CodePlex - Team Alert

It's a simple copy-paste solution which can take you 5 minutes to put in place using the configuration extract listed in the post below:

This post will show the exact configuration you need to perform what you want. Notify AssignedTo user of new work (for a specific TFS project)

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!