Changing TFS email notifications to link to Team System Web Access

Thanks to this MSDN Forums post I was able to change the link included in every TFS notification e-mail to point to TSWA instead of the project portal.

Here’s the full story:

When using project alerts to get notified about work item changes you get an email containing a link to the project portal:

Work Item Changed email notification by TFS

If you follow the link you might get a bit dissapointed when looking at this very basic work item details page:

Project Portal Work Item Details

Since Team System Web Access is now avaible from Microsoft free of charge we can change the link in the template for all notification messages to point to the new TSWA.

Changing the e-mail template

  1. On the TFS app tier open the folder:
    %ProgramFiles%\Microsoft Visual Studio 2005 Team Foundation Server\Web Services\Services\v1.0\Transforms
  2. Create a backup of the file WorkItemChangedEvent.xsl, which we will be editing in the next step.
  3. Replace the text:

    <xsl:value-of select="DisplayUrl" />

    with:

    <xsl:value-of select="concat(substring-before(DisplayUrl,':8080/WorkItemTracking/WorkItem.aspx?artifactMoniker=’),':8090/wi.aspx?id=’,substring-after(DisplayUrl,’artifactMoniker=’))" />

    The bold printed 8090 is the port where you installed TSWA at.
  4. Save the file and you are done.

If you now get a new notification e-mail and click on the link you’ll see the following much nicer work item details form provided by TSWA:

Team System Web Access Work Item Detail Form

Note: Be aware that you either need to use Windows authentication with TSWA to make this work or you need to be already logged in and the session must be still alive.

 

I published a 2nd part: Changing TFS emails to link to Team System Web Access – Part 2

6 thoughts on “Changing TFS email notifications to link to Team System Web Access”

  1. For TeamPlain 2.0, the link should be:
    :8090/UI/Pages/WorkItems/WorkItemEdit.aspx

    It requires you to open TeamPlain in the brower first, or you’ll get “Session expired or you are not logged in” error?

    Is there a link can automatically log in?

    I’m using Integrated Windows Authentication.

    Thanks!

  2. Cant get the syntax correct:

    Have tried what Markus Unterauer posted with no luck.

    When I hover over the link it act like it is looking at the “http://lewis:8080/wi.aspx?id=413″

    Here is what I tried:

    with

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>