简体   繁体   English

TFS电子邮件通知

[英]TFS email notification

When I add a bug (Work Item) in TFS, and assign it to a user, I want an email sent to that user. 当我在TFS中添加错误(工作项)并将其分配给用户时,我希望向该用户发送一封电子邮件。

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? 是否可以在TFS 2008中为用户分配更改的错误时向用户发送警报?

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. 至少在VS 2005中,在“ Team菜单上,您将找到“ Project Alerts...项,该项允许用户指定在My work items are changed by others时将收到通知的电子邮件地址,其中包含您提及的情况。 I imagine VS 2008 will have a similar thing. 我想VS 2008会有类似的事情。

Unfortunately, TFS doesn't have anything built out of the box for this to be done without recipient intervention. 不幸的是,TFS没有任何可以在没有接收者干预的情况下开箱即用的东西。 Richard Ev comment can work, but is not really sustainable. Richard Ev的评论可以发挥作用,但实际上并不可持续。 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 . 这是一篇非常有用的文章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. 您将需要使用IIdentityManagementService来检索相应用户的电子邮件。 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 . 在VS 2010中,如果安装了TFS 2010 Power Tools ,则可以转到“ 团队”菜单并选择“ 警报资源管理器” 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. 我知道你的帖子是2008年的,但这是一个老帖子,希望你现在在2010年。 For TFS 2010 there is an easy solution for you now, via a plugin which can be downloaded from CodePlex - Team Alert 对于TFS 2010,现在有一个简单的解决方案,可通过可从CodePlex下载的插件- 团队警报下载

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: 这是一个简单的复制粘贴解决方案,使用下面帖子中列出的配置提取,您可以花5分钟到位:

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) 通知AssignedTo用户新工作(针对特定TFS项目)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM