locked
Notification Questions - What can I do, where, and when? RRS feed

  • Question

  • Hi all,

    I almost have my CI environment in working order, but have some questions regarding notifications.  Currently, my Build Definition is set to call both a Pre and Post-Build script.  I don't have any notifications set up currently, but need to do so.

    I'm wondering if there is a way to only notify certain folks, namely myself, if the build fails in either the Pre or Post-Build script.  Those are my areas so no other developers need to be notified of any problems there.

    So what I would like to do is notify the Developers if the process errors during MSBuild, but only send notification to myself if something in the scripts goes awry.  Is that possible?

    My initial thought(s) is that I can certainly use try catch blocks in my scripts and script the sending of the email from within the catch block.

    I have another post floating around regarding script error codes and stopping the build if the script returns an error code <> 0.  This may trigger a notification to all, if there isn't a way to handle failures in scripts vs MSBuild processes.

    I'm also thinking that there would be a way to do this by modifying the template, but I'm trying to keep the process as simple as possible and really don't want to go down the template modification path.

    Any tips, pointers, help is always appreciated!

    Wednesday, October 7, 2015 11:22 PM

Answers

  • I'm looking into a few things. 

    First, I want to notify each developer (build requester) if the build fails after their checkin.  I think I have that down with the Project Alerts, however I'm not sure what field value to use in the notification setup, Requested for or Requested by.  I also have on this alert setup Contains [Me] as the condition.  I was logged in creating notification for other users so I don't know if that [Me] really means myself in that they will receive notification if my build after checkin fails or if it truly reflects that individual for whom I set up the notification.

    As far as the scripting goes, I think I will just use PowerShell to send emails to myself for needed notifications and not rely on TFS for that piece.

    Wednesday, October 14, 2015 1:12 PM

All replies

  • Hi,

    Thanks for posting here.

    I think your idea is usually good no matter whether it can be realized or not.

    This function is not supported by TFS of course. However, I think it should be possible to achieve it. After reading this https://tfsalertsdsl.codeplex.com/ and https://social.msdn.microsoft.com/Forums/vstudio/en-US/24e25684-7365-467f-afa3-d40af818de24/tfs-api-to-email-user?forum=tfsgeneral, we will  know that we may create an Alert with SOAP format and specify the web service endpoint in the "send to" filed then we can custom our email message with normal c# code. So if we can do this, when the script occur errors and be caught, we use our custom email to send alert. But this is also only a thinking, you may consider having a try.

    May


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Thursday, October 8, 2015 9:56 AM
    Moderator
  • I have yet to look into the information you provided, but another question crossed my mind.  I've set up build success and failure notifications only to myself, so I can monitor the initial use of our CI process.

    When I receive the emails I noticed it listed the individual who checked in the last changes...

    Request 96

    John Doe

    Completed

    My question is - is there any way to send the email, mainly failure notifications, to the individual who made the build request (checked something in)?

    Friday, October 9, 2015 8:07 PM
  • >My question is - is there any way to send the email, mainly failure notifications, to the individual who made the build request (checked something in)?

    How about this issue now? Do you find any way to achieve this?


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, October 14, 2015 9:11 AM
    Moderator
  • I'm looking into a few things. 

    First, I want to notify each developer (build requester) if the build fails after their checkin.  I think I have that down with the Project Alerts, however I'm not sure what field value to use in the notification setup, Requested for or Requested by.  I also have on this alert setup Contains [Me] as the condition.  I was logged in creating notification for other users so I don't know if that [Me] really means myself in that they will receive notification if my build after checkin fails or if it truly reflects that individual for whom I set up the notification.

    As far as the scripting goes, I think I will just use PowerShell to send emails to myself for needed notifications and not rely on TFS for that piece.

    Wednesday, October 14, 2015 1:12 PM