# TeamCity integration

[TeamCity](https://www.jetbrains.com/teamcity/) is a powerful continuous integration and delivery (CI/CD) server developed by JetBrains, used to build, test, and deploy code automatically. The ilert integration for TeamCity enables you to automatically send build and deployment alerts to ilert

## In ilert: Create a TeamCity alert source

1. Go to **Alert sources** -> **Alert sources** and click **Create new alert source**.

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FjX0cS4q7woTXKajZmc1W%2FScreenshot%202023-08-28%20at%2010.21.10.png?alt=media&#x26;token=8ef3666b-84eb-4b51-abee-f07303313941" alt=""><figcaption></figcaption></figure>
2. Search for **TeamCity** in the search field, click the TeamCity tile, and then **Next**.

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FlXzQlJpaTFSR49AZk0xA%2FScreenshot%202023-08-28%20at%2010.24.23.png?alt=media&#x26;token=cffeacb4-57b9-47d4-827d-b0f6b1afd914" alt=""><figcaption></figcaption></figure>
3. Give your alert source a name, optionally assign teams, and click **Next**.
4. Select an **escalation policy** by creating a new one or assigning an existing one.

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FNnuZqONaIhbOf6fn4OkZ%2FScreenshot%202023-08-28%20at%2011.37.47.png?alt=media&#x26;token=8a74f7b5-5bd2-4eea-97fa-1c1dbb041333" alt=""><figcaption></figcaption></figure>
5. Select your [Alert grouping](https://docs.ilert.com/alerting/configure-alerting/alert-sources#alert-grouping) preference and click **Continue setup**. You may click **Do not group alerts** for now and change it later.

   <figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FueugN4JgHn1c90ggFA6u%2FScreenshot%202023-08-28%20at%2011.38.24.png?alt=media&#x26;token=b8009daf-3ca8-4264-a6fa-e42ef7333205" alt=""><figcaption></figcaption></figure>
6. The next page shows additional settings, such as customer alert templates or notification priority. Click **Finish setup** for now.
7. On the final page, an API key and/or webhook URL will be generated. You will need it later.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FD9v83rBwSHz5Ovy5Npyb%2Fil-1.png?alt=media&#x26;token=a7b47472-61ad-4b2b-b534-6059851c42e9" alt=""><figcaption></figcaption></figure>

## In TeamCity: Enable and configure Webhook

1. On the side bar, navigate to **Admin** -> **Projects** -> **\<Root project>**.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FcijbSsjL0Vi8NG5fjmbg%2F1.png?alt=media&#x26;token=57ad4f70-5d51-4786-9236-ecc744e71cab" alt=""><figcaption></figcaption></figure>

2. Now click on **Parameters** -> **Add new parameter**.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FcFMkUmNidM2uMpN1SEYb%2F2.png?alt=media&#x26;token=2ea0ea32-4f64-4c91-be6f-59220c65f19d" alt=""><figcaption></figcaption></figure>

3. Add following parameter:\
   **Name**: `teamcity.internal.webhooks.enable`\
   **Value**: `true`

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FdzubVvtQ5Ws5sNCX9Wr7%2F3.png?alt=media&#x26;token=f6ca7951-cc4c-4d5e-b593-14947fa7d6fc" alt=""><figcaption></figcaption></figure>

4. Add another parameter:\
   **Name**: `teamcity.internal.webhooks.url`\
   **Value**: enter the in ilert previous generated alert source url

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FBYfuHHCPm4kgOb4GKh69%2F4.png?alt=media&#x26;token=6d70bf26-e8bf-4479-95bf-ef49cd694828" alt=""><figcaption></figcaption></figure>

5. Add another parameter:\
   **Name**: `teamcity.internal.webhooks.events`\
   **Value**: `BUILD_STARTED; BUILD_FINISHED; BUILD_INTERRUPTED`
6. Click on **Save** to finish the setup.

<figure><img src="https://3394882078-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M76ygPnS4HUcFSX8ulm%2Fuploads%2FXl7ayeK3WqWAfyLJZcdO%2F5.png?alt=media&#x26;token=3b87f14b-1946-4da8-aab8-646ca8f2e910" alt=""><figcaption></figcaption></figure>

## FAQ <a href="#faq" id="faq"></a>

**Will alerts in ilert be resolved automatically?**

No, unfortunately TeamCity is not compatible with ilert's resolve event.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.ilert.com/integrations/inbound-integrations/teamcity.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
