Webhook
User can configure project-level webhooks to let Bytebase post messages to the configured webhook endpoint upon various events.
Supported events
Issue creation
- Post message when issue belonging to the configured project has been created.Issue status change
- Post message when the status of the issue belonging to the configured project has been changed.Issue stage status change
- Post message when issue's enclosing stage status has been changed.Issue task status change
- Post message when issue's enclosing task status has been changed.Issue info change
- Post message when issue's basic info such as assignee, title, description has been changed.Issue comment creation
- Post message when new comment added to the issue.
The following events support sending direct messages/notifications to related users, you must enable the Enable direct messages
option to enable this feature.
Issue approval needed
- Post message when issue needs approval.Issue approved
- Post message when issue has been approved.Issue rollout needed
- Post message when issue needs rollout.
Supported webhook endpoints
Slack
Configure sending direct messages to related users
-
Go to https://api.slack.com/apps.
-
Click Create New App.
-
Choose From an app manifest.
-
Pick your workspace to develop the app and click Next.
-
Replace the existing JSON with this manifest content and click Next.
-
Click Create.
-
Click Install to Workspace and click Allow.
-
Go to Features > OAuth & Permissions and copy the Bot User OAuth Token.
-
Go back to Bytebase and paste the Bot User OAuth Token to the Token field under Integration > IM.
-
Go to Integration > Webhooks in a project, add a webhook, check all the events you want to send direct messages, and click Create.
Discord
Microsoft Teams
DingTalk
Feishu (Lark)
Configure sending direct notifications to related users
- Go to https://open.feishu.cn/app.
- Click Create Custom App, fill the form and click Create.
- Click Permisions & Scopes on the left sidebar, find and add the following permissions:
contact:user.id:readonly
im:message:send_as_bot
- Click Create Version.
- Configure availability.
WeCom
WeCom does not provide its own official guide. Please follow this similar setup from Tencent Cloud instead.
Configure sending direct messages to related users
- Go to https://work.weixin.qq.com/wework_admin/frame#apps.
- Click the tab My Company, and then you can find Company ID in the Company Information.
- Click the tab App Management, and choose Create an app under Self-built.
- Open the app,
- Find AgentId and Secret.
- Configure Allowed users.
- Configure Company's Trusted IP to your Bytebase instance IP.
- Make sure the user's email in Bytebase is the same as the user's email (not External account) in WeCom.
Custom
Custom is used to integrate with your own services via webhook.
API Definition as follow:
-
HTTP Method
POST
-
Request Header
Key Value Description Content-Type
application/json
JSON content -
Request Body
Key Type Description level
String One of:
INFO
SUCCESS
WARN
ERROR
activity_type
String One of:
bb.issue.create
bb.issue.comment.create
bb.issue.field.update
bb.issue.status.update
bb.pipeline.task.status.update
title
String Webhook title description
String Webhook description link
String Webhook link creator_id
Integer Updater id creator_name
Integer Updater name created_ts
Integer Webhook create timestamp issue
Object Issue Object - id
Integer Issue ID - name
String Issue Name - status
String Issue Status, one of:
OPEN
DONE
CANCELED
- type
String Issue Type, one of:
bb.issue.database.create
bb.issue.database.grant
bb.issue.database.schema.update
bb.issue.database.schema.update.ghost
bb.issue.database.data.update
bb.issue.database.rollback
bb.issue.database.data.export
- description
String Issue Description project
Object Project Object - id
Integer Project ID - name
String Project Name -
Response Body
Key Type Description code
String Zero if success, non-zero if failed message
String Some error message -
Response StatusCode
- 200, OK
- Other, if any error
Example Request Body
Example Response Body
- Success
- Failed