# Bitbucket 웹훅을 Pocket Alert에 연동하는 방법

> Bitbucket 웹훅을 연결하는 간단한 몇 단계

*18.06.2024*

<!-- source: https://pocketalert.app/ko/blog/how-to-integrate-bitbucket-webhooks-into-pocket-alert -->

[//]: # '# Bitbucket 웹훅을 pocket alert에 연동하는 방법'

## 새 웹훅 만들기

![create webhook](https://cdn.pocketalert.app/guides/git/webhook-create.gif)

1. [Webhooks](https://pocketalert.app/webhooks) 페이지로 이동하세요
2. "Create" 버튼을 클릭하세요
3. 다음 정보를 양식에 입력하세요:
   - **Name**: 웹훅의 이름
   - **Application**: 웹훅을 연결할 애플리케이션
   - **Device**: 웹훅을 연결할 기기
   - **Message**: 웹훅이 트리거될 때 보낼 메시지
4. "Create" 버튼을 클릭하세요
5. 웹훅의 URL을 복사하세요

**메시지에서 \*를 지정하면 모든 JSON을 가져온 뒤 필요한 파라미터를 직접 정할 수 있습니다.**

## Bitbucket에 웹훅 추가하기

![bitbucket add webhook](https://cdn.pocketalert.app/guides/git/bitbucket-add-webhook.gif)

1. 저장소 설정으로 이동하세요
2. "Webhooks" 탭을 클릭하세요
3. "Add webhook" 버튼을 클릭하세요
4. 다음 정보를 양식에 입력하세요:
   - **Title**: 웹훅의 제목
   - **URL**: 웹훅의 URL을 붙여넣으세요
   - **Content type**: application/json
   - **Secret**: 웹훅의 시크릿
   - **Triggers**: 웹훅을 트리거할 이벤트를 선택하세요
   - "Save" 버튼을 클릭하세요

## 최종 설정

Bitbucket에서 웹훅을 설정하고 저장소에 커밋을 푸시하면 Pocket Alert 앱에서 메시지를 확인할 수 있습니다.

알림을 생성하는 데 필요한 변수를 직접 정의할 수 있습니다.

예를 들어 커밋 메시지를 가져오고 싶다면 다음 코드를 사용하면 됩니다:

![webhook update](https://cdn.pocketalert.app/guides/git/bitbucket-webhook-update.png)

```json
Commit: %push.changes.0.commits.0.message%
Author: %push.changes.0.commits.0.author.user.display_name%

Date: %push.changes.0.commits.0.date%
```

변수에 대한 자세한 내용은 [Webhook Settings](https://info.pocketalert.app/api/webhooks/settings.html)에서 확인할 수 있습니다.

## Pocket Alert 앱의 메시지 예시

![messages](https://cdn.pocketalert.app/guides/git/bitbucket-webhook-messages.png)

---

![message](https://cdn.pocketalert.app/guides/git/bitbucket-webhook-message.png)

## 마치며

이 가이드에서는 Bitbucket 웹훅을 pocket alert 앱에 연동하는 방법을 살펴보았습니다. 새 웹훅을 만들고, Bitbucket에 웹훅을 추가하고, Pocket Alert 앱에서 메시지를 활용하는 방법을 알아보았습니다. Pocket Alert 앱에서 메시지가 어떻게 보이는지 예시도 함께 확인했습니다. 이 가이드가 도움이 되었기를 바랍니다. 궁금한 점이 있으면 언제든지 문의해 주세요. 언제든 도와드리겠습니다. 이 가이드를 읽어 주셔서 감사합니다.
