We use TFS 2010 for our work item tracking, source control, and build services. Beta 2, which is the currently released version of TFS & Visual Studio 2010, is nice and a very strong upgrade for those using 2008. I’ve spent a lot of time getting familiar with TFS, a lot more than in the past, and I’ve found a few things that threw me off and I will share them with you as time permits.
A key foundation of our escalation process is the ability to do alerting as items are introduced into the system, or modified, or lastly moved to a new state. We use email for our alerting and I’ve found a little quirk that seems to be “well known” (by the TFS product group) but maybe not to the world as I discovered. We used several stock queries that we already have built and stored in TFS as the basis for our alert queries.
Turns out, this didn’t work…So here goes some guidance from the pain & sweat that I went through to get it working.
Prior to using email alerting, you are required to run TFS using a service account. The service account should be a email-enabled (in our case, Exchange mailbox) so that it can successfully send email in your organization. To setup your alerts in TFS 2010, you do the following:
I recently asked one of my resident TFS experts to help me during this process of troubleshooting alerts & email. I asked him how one might could troubleshoot that Email alerting has been setup correctly in TFS. I was surprised that he wasn’t exactly sure what I meant so I realized that it wasn’t a common question. In my case, I didn’t know whether my alerting problem was email alert configuration setup incorrectly or whether it was the query evaluator so I wanted to “test” email.
The first steps to try is to get out of TFS and validate that you can successfully, from your TFS application server, connect to your email server and send an email. Let’s walk through this…
Before you freak out, don’t worry. Wait… you already freaked so don’t throw your keyboard as there might be a logical explanation for this. The one thing that I see again & again with administrators or Developers is they forget that Windows Server 2008 & above ships with the Windows Firewall enabled. The typical issue that occurs is that a firewall is blocking the connection out to your SMTP server. This can also be the problem in locked down network environments so ensure you have enabled SMTP in your network firewall.
To enable SMTP for the Windows Firewall in Server 2008, do the following:
Finish the configuration by clicking Next and you will now have the firewall port opened for outbound SMTP. Unless you are using a Telnet Server, you shouldn’t need an inbound rule. Try your telnet test again from the steps above.
The easiest approach for alerting is to start with a very, very simple query such as “when something is assigned to me.” This is a stock query that can be created by the system and is a good blueprint to what is a working query event to trigger the alert. Afterwards, you can then start making more complex alerts to meet your business needs.
In my case, I got the very simple stock to work with no problem. However, when I started creating an alert from a "[Blank Rule]” is when all #@## started happening and nothing was getting emailed. After doing an evaluation a bit between the working & non-working queries, I noticed that the stock alerts shipped with TFS all used “Portfolio Project” rather than “Team Project”. This was interesting to me so after making a slight modification to my alert the spam door was opened and it flooded my local mailbox. After investigating for a few days off & on, let’s just say this was the kind of spam I was happy to see!
To use email alerts in TFS 2010, you must have have the following in your query “Portfolio Project” = ‘TFS Project Name’. This will cause the event subscription service evaluator to work correctly and now you will start receiving your email.
Grant Holliday’s blog provided some useful tracing capabilities for testing alerting. For purposes of this post, I just wanted to give a shout out to his post as it helped quite a bit in getting to the bottom of this issue. However, I did just use some old troubleshooting steps used by all of us – find one that works and then determine the difference. This technique works quite often!
Looks like the "Portfolio Project" thing is no longer true in TFS 2010 RC, but I can't find any reference to it other than your blog. Can you update the post if RC has removed that requirement? Thanx.
I'm not sure if it is a requirement but from my discussion with the product group this wouldn't get changed in TFS 2010. I've setup a quick test using Team Project to see if it works and will let you know. Stay tuned...
I just re-tested and this time I provided Portfolio Project rather than Team Project. You could always cut this parameter/value if you have a single collection, with a single project, you shouldn't need to worry about this value.
However, if you have multiple TFS 2010 project collections, with multiple projects, you have to specify the project to get the alerts you are interested.
You have two options - ProjectPortfolio or TeamProject. If you choose TeamProject and specify the value, your alerts will not be sent (via email, at least). The schema requires you to use ProjectPorfolio and I followed up with Grant from the TFS product group and he confirmed this to be the case. Thus, my blog post is still applicable to RC1 :) and will also be the case for RTM.
This didn't change in RC1.
Hope this helps,
I can't find "ProjectPortfolio" - where is it?
Setting this option up shouldn't really be that difficult so I am quite surprised.
Thanks for writing. It isn't actually called 'Project Portfolio' but instead called Portfolio project. To locate in in TFS 2010 RC1 & RTM, you would click Team, select Alert Explorer, and then click New Alert --> Blank Alert.
In the first line of the query, it should auto-populate with 'Portfolio Project' which you can set to the specific project you are interested in alerting on.
Does this help?
<quote>you would click Team, select Alert Explorer, and then click New Alert --> Blank Alert.</quote>
Thanks for replying, Cris.
That's what I don't get it - how do you even get to that point? I see no options what so ever and I do have mfull product.
Hey there... are you on TFS 2010? Or are you on TFS 2008?
If you provide me a location I recorded a quick video (.mp4) that I'm happy to send you that shows you what I do :)