TFS email notification

2020-08-10 05:56发布

When I add a bug (Work Item) in TFS, and assign it to a user, I want an email sent to that user.

Also if an existing bug has the "Assigned To" changed, I want that user to get an email. Is it possible to send Alerts to users when they're assigned changed bugs in TFS 2008?

标签: email tfs alerts
4条回答
兄弟一词,经得起流年.
2楼-- · 2020-08-10 06:34

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.

查看更多
对你真心纯属浪费
3楼-- · 2020-08-10 06:35

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.

查看更多
兄弟一词,经得起流年.
4楼-- · 2020-08-10 06:48

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);
                }
            }
查看更多
闹够了就滚
5楼-- · 2020-08-10 06:57

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)

查看更多
登录 后发表回答