55

In Husdon/Jenkins, I can setup notifications when the build is broken to email the user(s) that made the checkins that broke the build. How do I do this in Teamcity?

I am aware that individual users can setup email notifications for themselves via the Teamcity interface (for when the build is broken), but I ONLY want emails sent to the users that broke the build, also I don't want the requirement that every individual user have to update their Teamcity settings.

vicsz
  • 9,552
  • 16
  • 69
  • 101
  • which teamcity version are you using? – ashwoods May 30 '11 at 21:28
  • Teamcity 6.0 Enterprise .. seems like the only solution will be to make a custom notifer – vicsz May 30 '11 at 21:39
  • or upgrade if you still have an active subscription. (or for free if you have less than 20 builds confs, other restrictions have fallen) – ashwoods May 30 '11 at 23:00
  • Does 6.5 support explicitly emailing the person that broke the build (irrelevant of roles/groups)? – vicsz May 31 '11 at 16:21
  • 1
    yes it does: i think it is set up that way out of the box, but you can just set it up in group everybody, which everybody is a member of by default. – ashwoods Jun 01 '11 at 08:58

3 Answers3

88
  • Open TeamCity in your browser.
  • Browse to Administration > Users and Groups > Groups
  • Click on the group name All Users
  • Select the tab Notification Rules (you see the Email notifier rules by default)
  • Click on Add new rule
  • choose in the column Watch the option Builds affected by my changes
  • choose in the column Send notification when the checkbox The build fails and Ignore failures not caused by my changes
  • Save this new notification rule with klick on the Save button.

A notification rule created that way works for all users. That's because the notification rule was created in the administration section within the group All Users, and not within one users personal notification settings. This works also in earlier versions of TeamCity, e.g. in 5.x.

The user still has the option to define additional rules if needed.

Darren Reid
  • 2,322
  • 20
  • 25
KimCM
  • 1,411
  • 11
  • 14
  • 2
    Don't forget to check SPAM folder! I've lost one hour of my life trying to figure out where the heck are the emails from TeamCity =) – agamov Jul 18 '13 at 06:13
  • There is a way to customize the notification content if you or your SPAM-filter does not like the TeamCity defaults. Please have a look at http://confluence.jetbrains.com/display/TCD8/Customizing+Notifications. – KimCM Jul 19 '13 at 12:03
  • 1
    In TeamCity 10 I'm not seeing the option for "Builds affected by my changes" but I do see "Builds containing my changes" do you know if this is now the equivalent or has the option been removed? – Steji Jan 18 '17 at 08:20
  • It's the equivalent. – Federico Nafria Jan 23 '18 at 18:39
1

I realize this question is dated, and a lot of teams now use Slack. So for those of us that consider e-mail "so 2011", my team has been finding success with this nice Slack Plug-in notifier just for this purpose:

https://github.com/PeteGoo/tcSlackBuildNotifier

Simply upload the zip to the Team City plugins folder, restart the Team City server, and then configure the notifications from the Admin/Build config settings. Also, create a Slack webhook to use in the API Token field.

It can be configured to notify on a number of conditions, but we're only using the "Trigger when build fails" option currently.

starmandeluxe
  • 2,443
  • 3
  • 27
  • 44
  • And as of TeamCity 2020.1, there is out-of-box [Slack notification plugin in TeamCity](https://www.jetbrains.com/teamcity/whatsnew/#version-2020-1-level-up-your-notifications). – KIR May 21 '20 at 15:33
1

At least with Teamcity 6.5 you have roles and groups, and you can set notifications settings based on them.

To achieve what you want, just take a look at the notification for group ALL (everybody) that is configured by default and you can't delete it.

http://yourteamcityinstall/admin/editGroup.html?groupCode=ALL_USERS_GROUP&tab=groupNotifications

ashwoods
  • 2,209
  • 1
  • 22
  • 36