Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

TFS Build email alerts to the [Requested By] user

Tags:

build

alert

Is this possible? Me and one of my co-worker are looking for this kind of solution for a while now and we can't find anything similar on Google.

The thing is simple. We want to automatically alert the [Requested By] user by email when he or she break the build on TFS 2010. How can we do this, there must be a solution, Microsoft can't had forgotten one of the simplest feature that can be added...

Thanks for your answers. If you need more clarifications about my question, please ask!

like image 874
David Avatar asked Feb 29 '12 15:02

David


People also ask

How do I enable email notifications in TFS?

We can enable email alerts by configuring the SMTP server for TFS. Open TFS Administration Console, select Application Tier and click “Alert Settings”. Provide the SMTP detail; for the purpose of the demo, we have used Gmail.

How will you get notified when changes are made to the pull request?

To track the progress of a single pull request, choose the actions icon for the pull request, and select the Follow option. This signals the system to notify you when changes are made to the PR.

How will you get notified when changes are made to the pull request Azure DevOps?

You can subscribe to email alerts to be notified of changes in pull requests (PRs). By default, you're subscribed to several common PR notifications. For a complete list of default subscription notifications, see Out-of-the-box (OOB) or default subscriptions.


2 Answers

You can do this, but you have to customise the build process or use web services, I've done this by customising our build process. I used a list of users from associatedChangesets instead of requested by.

  1. Get the TFS Build Extenstions.
  2. Open your build process template (guides here and here).
  3. Navigate to the "If a Compilation Exception Occurred" section.
  4. Drag on the "Email" activity from the "TFS Build Extensions".
  5. In the "To" field enter the following VB.Net:

To:

New String() { _
    DirectCast(
        New System.DirectoryServices.DirectorySearcher( _
        String.Format("(&(objectClass=user)(|{0}))", BuildDetail.RequestedBy)) _
        .FindOne(), SearchResult) _
        .Properties("mail")(0).ToString() _
}

6: Complete the rest of the fields in the Email activity.

like image 72
DaveShaw Avatar answered Sep 24 '22 18:09

DaveShaw


Yes - you will be able to do this with the next version of Team Foundation Server. I have an example of it here on my blog post: http://www.edsquared.com/2012/02/09/Creating+EMail+Alerts+For+Team+Members+In+TFS.aspx

enter image description here

like image 45
Ed Blankenship Avatar answered Sep 23 '22 18:09

Ed Blankenship