Features How-To's Tips & Tricks

Customizing TeamCity notifiers’ templates

TeamCity users can get notifications on different events of the projects they are watching, such as build start and failure, notifications on successfully completed builds or changing of the person responsible for the build failure. TeamCity has a number of means of notifying users on such events:

In the latest EAP build, we have also implemented the RSS feed notification on finished builds of the particular build configuration.

All notifications have a standard layout but the administrators can customize the notification templates to better suit the needs of a particular project or the company’s typical workflow. You can access and modify these templates in a dedicated notifier configuration file (not in TeamCity web UI).

The notifier templates are stored in the notifier configuration file of TeamCity Data Directory. The syntax of the notifier configuration files is described in the *.dtd files and contains two customizable sections:

  • <templates/> – specific templates with notification messages
  • <events/> – the list of events to be notified on and referenced with the associated templates

All additional templates you want to be used are placed into the <templates> section, and each notifier type template must have a specific tag or sub-element or the notification text is put within the <template/> tag. All templates are attached to specific events such as build start, failure and others. Each notification event supports a specific set of substitution patterns. These are:

  • “build_started”
  • “build_successful”, “build_failed”, “build_failing”
  • “responsible_changed”

After you have modified the notifiers templates, TeamCity server applies changes on-the-fly.

One more notification event (also customizable) – the build is probably hanging – has appeared in one of the latest TeamCity 3.0 EAP builds.

The concrete examples of customizing the notifier templates are available in TeamCity online reference.

Technorati tags: ,, , , , , , , , , ,

Comments below can no longer be edited.

2 Responses to Customizing TeamCity notifiers’ templates

  1. Avatar

    Anna says:

    September 18, 2009

    Thanks for the artice, however I’m interested in how I can remove the “#” sign from the {BUILD_NUMBER} in the templates? I’m using it to provide links to the release repository location, and there’s no “#” sign in the paths.
    Can you help me with this?

    Thank you

  2. Avatar

    Ekaterina says:

    September 18, 2009

    Thank you for the comment. As for your question, would you please create a new topic at TeamCity Forum. I’m sure our developers will respond ASAP.

Discover more