zulip/templates/zerver/integrations/trac.md

1.7 KiB
Raw Blame History

First, create the stream youd like to use for Trac notifications, and subscribe all interested parties to this stream. The integration will use the default stream trac if no stream is supplied in the hook; you still need to create the stream even if you are using this default.

{! download-python-bindings.md !}

Next, open integrations/trac/zulip_trac_config.py in your favorite editor, and change the following lines to specify your bots email address, API key, and where youd like your notification messages to go (by default, stream trac):

ZULIP_USER = "trac-notifications-bot@example.com"
ZULIP_API_KEY = "0123456789abcdef0123456789abcdef"
STREAM_FOR_NOTIFICATIONS = "trac"
TRAC_BASE_TICKET_URL = "https://trac.example.com/ticket"
{% if api_site_required %}ZULIP_SITE ="{{ external_api_uri_subdomain }}"{% endif %}

Copy integrations/trac/zulip_trac.py and integrations/trac/zulip_trac_config.py into your Trac installations plugins/ subdirectory. Once youve done that, edit your Trac installations conf/trac.ini to add zulip_trac to the [components] section, as follows:

[components]
zulip_trac = enabled

You may then need to restart Trac (or Apache) so that Trac will load our plugin.

When people open new tickets (or edit existing tickets), youll see a message like the following, to the stream trac (or whatever you configured above) with a topic that matches the ticket name

{! congrats.md !}

Additional trac configuration

After using the plugin for a while, you may want to customize which changes to tickets result in a Zulip notification using the TRAC_NOTIFY_FIELDS setting in zulip_trac_config.py.