イベント ペイロード
When you have a webhook with an event, Bitbucket Data Center and Server sends the event request to the server URL for the webhook whenever that event occurs. This page describes the structure of these requests.
For Bitbucket to send event payload requests for a webhook with HTTPS endpoints, make sure your URL has a valid SSL certificate that a public certificate authority has signed.
The following payloads contain some of the five common entity types – U
ser
, Repository
, Comment
, and Pull Request
– which have consistent representations in all the payloads where they appear. For example, the actor
property in the repo:refs_changed
payload is a representation of the event's user.
HTTP ヘッダー
すべてのイベント ペイロードには次の HTTP ヘッダーがあります。
HTTP ヘッダー | 説明 |
---|---|
X-Request-Id | 各 webhook リクエストの一意の UUID。 |
X-Event-Key | この Webhook で開始されたイベント。例えば、リポジトリ プッシュは
|
X-Hub-Signature | 「Webhook シークレット」を参照してください。 |
リポジトリ イベント
リポジトリで発生する次のイベント用に Webhook を作成できます。
プッシュ
A user pushes one or more commits to a repository. This payload, with an event key of repo:refs_changed
, provides the following fields:
パラメーター | 説明 |
---|---|
actor | コミットをプッシュしたユーザー。 |
repository | コミットがあるリポジトリ。 |
変更 | プッシュの詳細。 |
{
"eventKey":"repo:refs_changed",
"date":"2017-09-19T09:45:32+1000",
"actor":{
"name":"admin",
"emailAddress":"admin@example.com",
"id":1,
"displayName":"Administrator",
"active":true,
"slug":"admin",
"type":"NORMAL"
},
"repository":{
"slug":"repository",
"id":84,
"name":"repository",
"scmId":"git",
"state":"AVAILABLE",
"statusMessage":"Available",
"forkable":true,
"project":{
"key":"PROJ",
"id":84,
"name":"project",
"public":false,
"type":"NORMAL"
},
"public":false
},
"changes":[
{
"ref":{
"id":"refs/heads/master",
"displayId":"master",
"type":"BRANCH"
},
"refId":"refs/heads/master",
"fromHash":"ecddabb624f6f5ba43816f5926e580a5f680a932",
"toHash":"178864a7d521b6f5e720b386b2c2b0ef8563e0dc",
"type":"UPDATE"
}
]
}
最終変更日
A user updates the Name of a repository. This payload, with an event key of repo:modified
, provides the following fields:
パラメーター | 説明 |
---|---|
古い | 古いバージョンのリポジトリの詳細。 |
new | リポジトリの最新バージョンのデフォルト。 |
actor | 更新を行ったユーザー。 |
{
"eventKey":"repo:modified",
"date":"2017-09-19T09:51:20+1000",
"actor":{
"name":"admin",
"emailAddress":"admin@example.com",
"id":1,
"displayName":"Administrator",
"active":true,
"slug":"admin",
"type":"NORMAL"
},
"old":{
"slug":"repository",
"id":84,
"name":"repository",
"scmId":"git",
"state":"AVAILABLE",
"statusMessage":"Available",
"forkable":true,
"project":{
"key":"PROJ",
"id":84,
"name":"project",
"public":false,
"type":"NORMAL"
},
"public":false
},
"new":{
"slug":"repository2",
"id":84,
"name":"repository2",
"scmId":"git",
"state":"AVAILABLE",
"statusMessage":"Available",
"forkable":true,
"project":{
"key":"PROJ",
"id":84,
"name":"project",
"public":false,
"type":"NORMAL"
},
"public":false
}
}
フォーク
ユーザーはリポジトリをフォークします。このペイロードには repo:fork
のイベント キーが含まれており、次のフィールドが提供されます。
パラメーター | 説明 |
---|---|
actor | リポジトリをフォークするユーザー。このユーザーはフォークの所有者でもあります。 |
repository | 新しいリポジトリ。 |
repository.origin | フォークされた元のリポジトリ。 |
{
"eventKey":"repo:forked",
"date":"2017-09-19T09:48:26+1000",
"actor":{
"name":"admin",
"emailAddress":"admin@example.com",
"id":1,
"displayName":"Administrator",
"active":true,
"slug":"admin",
"type":"NORMAL"
},
"repository":{
"slug":"repository2",
"id":86,
"name":"repository2",
"scmId":"git",
"state":"AVAILABLE",
"statusMessage":"Available",
"forkable":true,
"origin":{
"slug":"repository",
"id":84,
"name":"repository",
"scmId":"git",
"state":"AVAILABLE",
"statusMessage":"Available",
"forkable":true,
"project":{
"key":"PROJ",
"id":84,
"name":"project",
"public":false,
"type":"NORMAL"
},
"public":false
},
"project":{
"key":"~ADMIN",
"id":22,
"name":"Administrator",
"type":"PERSONAL",
"owner":{
"name":"admin",
"emailAddress":"admin@example.com",
"id":1,
"displayName":"Administrator",
"active":true,
"slug":"admin",
"type":"NORMAL"
}
},
"public":false
}
}
作成したコメントのコミット
ユーザーはリポジトリのコミットにコメントを追加します。このペイロードには repo:comment:added
のイベント キーが含まれており、次のフィールドが提供されます。
パラメーター | 説明 |
---|---|
actor | コミットにコメントを追加したユーザー。 |
comment | 作成されたコメント。 |
repository | コミットがあるリポジトリ。 |
commit | ハッシュ。 |
{
"eventKey":"repo:comment:added",
"date":"2017-09-19T09:53:06+1000",
"actor":{
"name":"admin",
"emailAddress":"admin@example.com",
"id":1,
"displayName":"Administrator",
"active":true,
"slug":"admin",
"type":"NORMAL"
},
"comment":{
"properties":{
"repositoryId":84
},
"id":42,
"version":0,
"text":"This is a great line of code!",
"author":{
"name":"admin",
"emailAddress":"admin@example.com",
"id":1,
"displayName":"Administrator",
"active":true,
"slug":"admin",
"type":"NORMAL"
},
"createdDate":1505778786337,
"updatedDate":1505778786337,
"comments":[
],
"tasks":[
],
"permittedOperations":{
"editable":true,
"deletable":true
}
},
"repository":{
"slug":"repository",
"id":84,
"name":"repository",
"scmId":"git",
"state":"AVAILABLE",
"statusMessage":"Available",
"forkable":true,
"project":{
"key":"PROJ",
"id":84,
"name":"project",
"public":false,
"type":"NORMAL"
},
"public":false
},
"commit":"178864a7d521b6f5e720b386b2c2b0ef8563e0dc"
}
コメントでのコミット編集
A user edits a comment on a commit in a repository. This payload, with an event key of repo:comment:edited
, provides the following fields:
パラメーター | 説明 |
---|---|
actor | コメントを編集したユーザー。 |
comment | 編集されたコメント。 |
previousComment | 編集前のコメントのテキスト。 |
repository | コミットがあるリポジトリ。 |
commit | コミットのハッシュ。 |
{
"eventKey":"repo:comment:edited",
"date":"2017-09-19T09:55:03+1000",
"actor":{
"name":"admin",
"emailAddress":"admin@example.com",
"id":1,
"displayName":"Administrator",
"active":true,
"slug":"admin",
"type":"NORMAL"
},
"comment":{
"properties":{
"repositoryId":84
},
"id":42,
"version":1,
"text":"This is a okay line of code!",
"author":{
"name":"admin",
"emailAddress":"admin@example.com",
"id":1,
"displayName":"Administrator",
"active":true,
"slug":"admin",
"type":"NORMAL"
},
"createdDate":1505778786337,
"updatedDate":1505778903525,
"comments":[
],
"tasks":[
],
"permittedOperations":{
"editable":true,
"deletable":true
}
},
"repository":{
"slug":"repository",
"id":84,
"name":"repository",
"scmId":"git",
"state":"AVAILABLE",
"statusMessage":"Available",
"forkable":true,
"project":{
"key":"PROJ",
"id":84,
"name":"project",
"public":false,
"type":"NORMAL"
},
"public":false
},
"commit":"178864a7d521b6f5e720b386b2c2b0ef8563e0dc",
"previousComment":"This is a great line of code!"
}
コミットでのコメント削除時
A user deletes a comment on a commit in a repository. This payload, with an event key of repo:comment:deleted
, provides the following fields:
パラメーター | 説明 |
---|---|
actor | コメントを削除するユーザー。 |
comment | 削除されたコメント。 |
repository | コミットがあるリポジトリ。 |
commit | コミットのハッシュ。 |
{
"eventKey":"repo:comment:deleted",
"date":"2017-09-19T09:56:29+1000",
"actor":{
"name":"admin",
"emailAddress":"admin@example.com",
"id":1,
"displayName":"Administrator",
"active":true,
"slug":"admin",
"type":"NORMAL"
},
"comment":{
"id":42,
"version":1,
"text":"This is a okay line of code!",
"author":{
"name":"admin",
"emailAddress":"admin@example.com",
"id":1,
"displayName":"Administrator",
"active":true,
"slug":"admin",
"type":"NORMAL"
},
"createdDate":1505778786337,
"updatedDate":1505778903525,
"comments":[
],
"tasks":[
]
},
"repository":{
"slug":"repository",
"id":84,
"name":"repository",
"scmId":"git",
"state":"AVAILABLE",
"statusMessage":"Available",
"forkable":true,
"project":{
"key":"PROJ",
"id":84,
"name":"project",
"public":false,
"type":"NORMAL"
},
"public":false
},
"commit":"178864a7d521b6f5e720b386b2c2b0ef8563e0dc"
}
Mirror synchronized
A mirror has finished synchronizing this repository. This payload, with an event key of mirror:repo_synchronized
, provides the following fields:
パラメーター | 説明 |
---|---|
mirrorServer | The mirror which synchronized the changes. This JSON object contains both the name and the id of the mirrorServer which synchronized the changes. |
syncType | The sync type the mirror used to synchronize the changes which are announced by this webhook. This value can be |
repository | The repository. |
repository.links | This JSON object contains the HTTP and SSH clone URLs of the primary server as well as the mirror that synchronized these changes. It also contains a link to view this repository in Bitbucket. |
変更 | The ref changes for this push. |
refLimitExceeded | If this value is true , the list of changes will be empty because it exceeded the limit of refs that can be included. |
{
"eventKey": "mirror:repo_synchronized",
"date": "2019-07-11T16:18:20+1000",
"mirrorServer": {
"id": "B88H-IR7J-5PV0-VCNS",
"name": "Mirror Name"
},
"syncType": "INCREMENTAL",
"refLimitExceeded": false,
"repository": {
"slug": "testrepo",
"id": 1,
"name": "testrepo",
"scmId": "git",
"state": "AVAILABLE",
"statusMessage": "Available",
"forkable": true,
"project": {
"key": "TP",
"id": 1,
"name": "testp",
"public": false,
"type": "NORMAL"
},
"public": false,
"links": {
"clone": [
{
"href": "ssh://git@example.com:7997/project/repository.git",
"name": "ssh"
},
{
"href": "https://example.com/scm/project/repository.git",
"name": "http"
}
],
"self": [
{
"href": "https://example.com/projects/project/repos/repo/browse"
}
]
}
},
"changes": [
{
"ref": {
"id": "refs/heads/master",
"displayId": "master",
"type": "BRANCH"
},
"refId": "refs/heads/master",
"fromHash": "b5616b9",
"toHash": "d055eca",
"type": "UPDATE"
}
]
}
プル リクエスト イベント
プル リクエストで発生する次のイベントのために webhook を作成できます。
オープン時
パラメーター | 説明 |
---|---|
actor | プル リクエストを作成したユーザー。 |
pullrequest | 作成されたプル リクエストの詳細。 |
{
"eventKey":"pr:opened",
"date":"2017-09-19T09:58:11+1000",
"actor":{
"name":"admin",
"emailAddress":"admin@example.com",
"id":1,
"displayName":"Administrator",
"active":true,
"slug":"admin",
"type":"NORMAL"
},
"pullRequest":{
"id":1,
"version":0,
"title":"a new file added",
"state":"OPEN",
"open":true,
"closed":false,
"createdDate":1505779091796,
"updatedDate":1505779091796,
"fromRef":{
"id":"refs/heads/a-branch",
"displayId":"a-branch",
"latestCommit":"ef8755f06ee4b28c96a847a95cb8ec8ed6ddd1ca",
"repository":{
"slug":"repository",
"id":84,
"name":"repository",
"scmId":"git",
"state":"AVAILABLE",
"statusMessage":"Available",
"forkable":true,
"project":{
"key":"PROJ",
"id":84,
"name":"project",
"public":false,
"type":"NORMAL"
},
"public":false
}
},
"toRef":{
"id":"refs/heads/master",
"displayId":"master",
"latestCommit":"178864a7d521b6f5e720b386b2c2b0ef8563e0dc",
"repository":{
"slug":"repository",
"id":84,
"name":"repository",
"scmId":"git",
"state":"AVAILABLE",
"statusMessage":"Available",
"forkable":true,
"project":{
"key":"PROJ",
"id":84,
"name":"project",
"public":false,
"type":"NORMAL"
},
"public":false
}
},
"locked":false,
"author":{
"user":{
"name":"admin",
"emailAddress":"admin@example.com",
"id":1,
"displayName":"Administrator",
"active":true,
"slug":"admin",
"type":"NORMAL"
},
"role":"AUTHOR",
"approved":false,
"status":"UNAPPROVED"
},
"reviewers":[
],
"participants":[
],
"links":{
"self":[
null
]
}
}
}
Source branch updated
パラメーター | 説明 |
---|---|
actor | プル リクエストを作成したユーザー。 |
pullrequest | 作成されたプル リクエストの詳細。 |
previousFromHash | Previous from-ref hash |
{
"eventKey": "pr:from_ref_updated",
"date": "2020-02-20T14:49:41+1100",
"actor": {
"name": "admin",
"emailAddress": "admin@example.com",
"id": 1,
"displayName": "Administrator",
"active": true,
"slug": "admin",
"type": "NORMAL",
"links": {
"self": [
{
"href": "http://localhost:7990/bitbucket/users/admin"
}
]
}
},
"pullRequest": {
"id": 2,
"version": 16,
"title": "Webhook",
"state": "OPEN",
"open": true,
"closed": false,
"createdDate": 1582065825700,
"updatedDate": 1582170581372,
"fromRef": {
"id": "refs/heads/pr-webhook",
"displayId": "pr-webhook",
"latestCommit": "aab847db240ccae221f8036605b00f777eba95d2",
"repository": {
"slug": "dvcs",
"id": 33,
"name": "dvcs",
"hierarchyId": "09992c6ad9e001f01120",
"scmId": "git",
"state": "AVAILABLE",
"statusMessage": "Available",
"forkable": true,
"project": {
"key": "GIT",
"id": 62,
"name": "Bitbucket",
"public": false,
"type": "NORMAL",
"links": {
"self": [
{
"href": "http://localhost:7990/bitbucket/projects/GIT"
}
]
}
},
"public": false,
"links": {
"clone": [
{
"href": "ssh://git@localhost:7999/git/dvcs.git",
"name": "ssh"
},
{
"href": "http://localhost:7990/bitbucket/scm/git/dvcs.git",
"name": "http"
}
],
"self": [
{
"href": "http://localhost:7990/bitbucket/projects/GIT/repos/dvcs/browse"
}
]
}
}
},
"toRef": {
"id": "refs/heads/master",
"displayId": "master",
"latestCommit": "86448735f9dee9e1fb3d3e5cd9fbc8eb9d8400f4",
"repository": {
"slug": "dvcs",
"id": 33,
"name": "dvcs",
"hierarchyId": "09992c6ad9e001f01120",
"scmId": "git",
"state": "AVAILABLE",
"statusMessage": "Available",
"forkable": true,
"project": {
"key": "GIT",
"id": 62,
"name": "Bitbucket",
"public": false,
"type": "NORMAL",
"links": {
"self": [
{
"href": "http://localhost:7990/bitbucket/projects/GIT"
}
]
}
},
"public": false,
"links": {
"clone": [
{
"href": "ssh://git@localhost:7999/git/dvcs.git",
"name": "ssh"
},
{
"href": "http://localhost:7990/bitbucket/scm/git/dvcs.git",
"name": "http"
}
],
"self": [
{
"href": "http://localhost:7990/bitbucket/projects/GIT/repos/dvcs/browse"
}
]
}
}
},
"locked": false,
"author": {
"user": {
"name": "admin",
"emailAddress": "admin@example.com",
"id": 1,
"displayName": "Administrator",
"active": true,
"slug": "admin",
"type": "NORMAL",
"links": {
"self": [
{
"href": "http://localhost:7990/bitbucket/users/admin"
}
]
}
},
"role": "AUTHOR",
"approved": false,
"status": "UNAPPROVED"
},
"reviewers": [],
"participants": [],
"links": {
"self": [
{
"href": "http://localhost:7990/bitbucket/projects/GIT/repos/dvcs/pull-requests/2"
}
]
}
},
"previousFromHash": "99f3ea32043ba3ecaa28de6046b420de70257d80"
}
最終変更日
パラメーター | 説明 |
---|---|
actor | プル リクエストを作成したユーザー。 |
pullrequest | 作成されたプル リクエストの詳細。 |
previousTitle | プル リクエストの以前のタイトル。変更されていない可能性もあります。 |
previousDescription | プル リクエストの以前の説明。変更されていない可能性もあります。 |
previousTarget | プル リクエストの以前のターゲット。変更されていない可能性もあります。 |
{
"eventKey": "pr:modified",
"date": "2018-04-24T10:15:30+1000",
"actor": {
"name": "Administrator",
"emailAddress": "example@atlassian.com",
"id": 110653,
"displayName": "Administrator",
"active": true,
"slug": "pathompson",
"type": "NORMAL"
},
"pullRequest": {
"id": 1,
"version": 1,
"title": "A new title",
"description": "A new description",
"state": "OPEN",
"open": true,
"closed": false,
"createdDate": 1524528879329,
"updatedDate": 1524528930110,
"fromRef": {
"id": "refs/heads/new-branch",
"displayId": "new-branch",
"latestCommit": "5a705e60111a4213da46839d9cbf4fc43639b771",
"repository": {
"slug": "example",
"id": 12087,
"name": "example",
"scmId": "git",
"state": "AVAILABLE",
"statusMessage": "Available",
"forkable": true,
"project": {
"key": "~ADMIN",
"id": 8504,
"name": "Administrator",
"type": "PERSONAL",
"owner": {
"name": "Administrator",
"emailAddress": "example@atlassian.com",
"id": 110653,
"displayName": "Administrator",
"active": true,
"slug": "admin",
"type": "NORMAL"
}
},
"public": false
}
},
"toRef": {
"id": "refs/heads/master",
"displayId": "master",
"latestCommit": "860c4eb4ed0f969b47144234ba13c31c498cca69",
"repository": {
"slug": "example",
"id": 12087,
"name": "example",
"scmId": "git",
"state": "AVAILABLE",
"statusMessage": "Available",
"forkable": true,
"project": {
"key": "~ADMIN",
"id": 8504,
"name": "Administrator",
"type": "PERSONAL",
"owner": {
"name": "Administrator",
"emailAddress": "example@atlassian.com",
"id": 110653,
"displayName": "Administrator",
"active": true,
"slug": "admin",
"type": "NORMAL"
}
},
"public": false
}
},
"locked": false,
"author": {
"user": {
"name": "Administrator",
"emailAddress": "example@atlassian.com",
"id": 110653,
"displayName": "Administrator",
"active": true,
"slug": "admin",
"type": "NORMAL"
},
"role": "AUTHOR",
"approved": false,
"status": "UNAPPROVED"
},
"reviewers": [
{
"user": {
"name": "User",
"emailAddress": "user@atlassian.com",
"id": 36303,
"displayName": "User",
"active": true,
"slug": "user",
"type": "NORMAL"
},
"role": "REVIEWER",
"approved": false,
"status": "UNAPPROVED"
}
],
"participants": [
]
},
"previousTitle": "A cool PR",
"previousDescription": "A neat description",
"previousTarget": {
"id": "refs\/heads\/master",
"displayId": "master",
"type": "BRANCH",
"latestCommit": "860c4eb4ed0f969b47144234ba13c31c498cca69",
"latestChangeset": "860c4eb4ed0f969b47144234ba13c31c498cca69"
}
}
レビュアーの更新
パラメーター | 説明 |
---|---|
actor | プル リクエストを作成したユーザー。 |
pullrequest | 作成されたプル リクエストの詳細。 |
removedReviewers | レビュアーではなくなったユーザー。 |
addedReviewers | レビュアーとして追加されたユーザー。 |
{
"eventKey": "pr:reviewer:updated",
"date": "2018-04-24T10:20:07+1000",
"actor": {
"name": "Administrator",
"emailAddress": "admin@atlassian.com",
"id": 110653,
"displayName": "Administrator",
"active": true,
"slug": "admin",
"type": "NORMAL"
},
"pullRequest": {
"id": 1,
"version": 2,
"title": "A title",
"description": "A description",
"state": "OPEN",
"open": true,
"closed": false,
"createdDate": 1524528879329,
"updatedDate": 1524529207598,
"fromRef": {
"id": "refs/heads/new-branch",
"displayId": "new-branch",
"latestCommit": "5a705e60111a4213da46839d9cbf4fc43639b771",
"repository": {
"slug": "example",
"id": 12087,
"name": "example",
"scmId": "git",
"state": "AVAILABLE",
"statusMessage": "Available",
"forkable": true,
"project": {
"key": "~ADMIN",
"id": 8504,
"name": "Administrator",
"type": "PERSONAL",
"owner": {
"name": "admin",
"emailAddress": "example@atlassian.com",
"id": 110653,
"displayName": "Administrator",
"active": true,
"slug": "admin",
"type": "NORMAL"
}
},
"public": false
}
},
"toRef": {
"id": "refs/heads/master",
"displayId": "master",
"latestCommit": "860c4eb4ed0f969b47144234ba13c31c498cca69",
"repository": {
"slug": "example",
"id": 12087,
"name": "example",
"scmId": "git",
"state": "AVAILABLE",
"statusMessage": "Available",
"forkable": true,
"project": {
"key": "~ADMIN",
"id": 8504,
"name": "Administrator",
"type": "PERSONAL",
"owner": {
"name": "Administrator",
"emailAddress": "admin@atlassian.com",
"id": 110653,
"displayName": "Administrator",
"active": true,
"slug": "admin",
"type": "NORMAL"
}
},
"public": false
}
},
"locked": false,
"author": {
"user": {
"name": "Administrator",
"emailAddress": "admin@atlassian.com",
"id": 110653,
"displayName": "Administrator",
"active": true,
"slug": "admin",
"type": "NORMAL"
},
"role": "AUTHOR",
"approved": false,
"status": "UNAPPROVED"
},
"reviewers": [
{
"user": {
"name": "pathompson_admin",
"emailAddress": "pathompson@atlassian.com",
"id": 129659,
"displayName": "Paul Thompson Admin",
"active": true,
"slug": "pathompson_admin",
"type": "NORMAL"
},
"role": "REVIEWER",
"approved": false,
"status": "UNAPPROVED"
}
],
"participants": [
]
},
"addedReviewers": [
{
"name": "new user",
"emailAddress": "user2@atlassian.com",
"id": 129659,
"displayName": "New User",
"active": true,
"slug": "new_user",
"type": "NORMAL"
}
],
"removedReviewers": [
{
"name": "user",
"emailAddress": "user@atlassian.com",
"id": 36303,
"displayName": "User",
"active": true,
"slug": "user",
"type": "NORMAL"
}
]
}
承認
ユーザーによるリポジトリでのプル リクエストの承認です。このペイロードには pr:reviewer:approved
のイベント キーが含まれており、次のフィールドが提供されます。
パラメーター | 説明 |
---|---|
actor | 承認を行ったユーザー。 |
pullrequest | 承認されたプル リクエストの詳細。 |
参加者 | 変更を加えるユーザーの PR 参加ステータスの詳細。 |
previousStatus | この変更の前の承認の状態。 |
{
"eventKey":"pr:reviewer:approved",
"date":"2017-09-19T10:10:01+1000",
"actor":{
"name":"user",
"emailAddress":"user@example.com",
"id":2,
"displayName":"User",
"active":true,
"slug":"user",
"type":"NORMAL"
},
"pullRequest":{
"id":1,
"version":1,
"title":"a new file added",
"description":"A new description, added a user",
"state":"OPEN",
"open":true,
"closed":false,
"createdDate":1505779091796,
"updatedDate":1505779257496,
"fromRef":{
"id":"refs/heads/a-branch",
"displayId":"a-branch",
"latestCommit":"ef8755f06ee4b28c96a847a95cb8ec8ed6ddd1ca",
"repository":{
"slug":"repository",
"id":84,
"name":"repository",
"scmId":"git",
"state":"AVAILABLE",
"statusMessage":"Available",
"forkable":true,
"project":{
"key":"PROJ",
"id":84,
"name":"project",
"public":false,
"type":"NORMAL"
},
"public":false
}
},
"toRef":{
"id":"refs/heads/master",
"displayId":"master",
"latestCommit":"178864a7d521b6f5e720b386b2c2b0ef8563e0dc",
"repository":{
"slug":"repository",
"id":84,
"name":"repository",
"scmId":"git",
"state":"AVAILABLE",
"statusMessage":"Available",
"forkable":true,
"project":{
"key":"PROJ",
"id":84,
"name":"project",
"public":false,
"type":"NORMAL"
},
"public":false
}
},
"locked":false,
"author":{
"user":{
"name":"admin",
"emailAddress":"admin@example.com",
"id":1,
"displayName":"Administrator",
"active":true,
"slug":"admin",
"type":"NORMAL"
},
"role":"AUTHOR",
"approved":false,
"status":"UNAPPROVED"
},
"reviewers":[
{
"user":{
"name":"user",
"emailAddress":"user@example.com",
"id":2,
"displayName":"User",
"active":true,
"slug":"user",
"type":"NORMAL"
},
"lastReviewedCommit":"ef8755f06ee4b28c96a847a95cb8ec8ed6ddd1ca",
"role":"REVIEWER",
"approved":true,
"status":"APPROVED"
}
],
"participants":[
],
"links":{
"self":[
null
]
}
},
"participant":{
"user":{
"name":"user",
"emailAddress":"user@example.com",
"id":2,
"displayName":"User",
"active":true,
"slug":"user",
"type":"NORMAL"
},
"lastReviewedCommit":"ef8755f06ee4b28c96a847a95cb8ec8ed6ddd1ca",
"role":"REVIEWER",
"approved":true,
"status":"APPROVED"
},
"previousStatus":"UNAPPROVED"
}
未承認時
ユーザーによるリポジトリでのプル リクエストからの承認の削除です。このペイロードには pr:reviewer:unapproved
のイベント キーが含まれており、次のフィールドが提供されます。
パラメーター | 説明 |
---|---|
actor | 承認を取り消したユーザー。 |
pullrequest | 承認されていないプル リクエストの詳細。 |
参加者 | 変更を加えるユーザーの PR 参加ステータスの詳細。 |
previousStatus | この変更の前の承認の状態。 |
{
"eventKey":"pr:reviewer:unapproved",
"date":"2017-09-19T10:13:43+1000",
"actor":{
"name":"user",
"emailAddress":"user@example.com",
"id":2,
"displayName":"User",
"active":true,
"slug":"user",
"type":"NORMAL"
},
"pullRequest":{
"id":1,
"version":1,
"title":"a new file added",
"description":"A new description, added a user",
"state":"OPEN",
"open":true,
"closed":false,
"createdDate":1505779091796,
"updatedDate":1505779257496,
"fromRef":{
"id":"refs/heads/a-branch",
"displayId":"a-branch",
"latestCommit":"ef8755f06ee4b28c96a847a95cb8ec8ed6ddd1ca",
"repository":{
"slug":"repository",
"id":84,
"name":"repository",
"scmId":"git",
"state":"AVAILABLE",
"statusMessage":"Available",
"forkable":true,
"project":{
"key":"PROJ",
"id":84,
"name":"project",
"public":false,
"type":"NORMAL"
},
"public":false
}
},
"toRef":{
"id":"refs/heads/master",
"displayId":"master",
"latestCommit":"178864a7d521b6f5e720b386b2c2b0ef8563e0dc",
"repository":{
"slug":"repository",
"id":84,
"name":"repository",
"scmId":"git",
"state":"AVAILABLE",
"statusMessage":"Available",
"forkable":true,
"project":{
"key":"PROJ",
"id":84,
"name":"project",
"public":false,
"type":"NORMAL"
},
"public":false
}
},
"locked":false,
"author":{
"user":{
"name":"admin",
"emailAddress":"admin@example.com",
"id":1,
"displayName":"Administrator",
"active":true,
"slug":"admin",
"type":"NORMAL"
},
"role":"AUTHOR",
"approved":false,
"status":"UNAPPROVED"
},
"reviewers":[
{
"user":{
"name":"user",
"emailAddress":"user@example.com",
"id":2,
"displayName":"User",
"active":true,
"slug":"user",
"type":"NORMAL"
},
"lastReviewedCommit":"ef8755f06ee4b28c96a847a95cb8ec8ed6ddd1ca",
"role":"REVIEWER",
"approved":false,
"status":"UNAPPROVED"
}
],
"participants":[
]
},
"participant":{
"user":{
"name":"user",
"emailAddress":"user@example.com",
"id":2,
"displayName":"User",
"active":true,
"slug":"user",
"type":"NORMAL"
},
"lastReviewedCommit":"ef8755f06ee4b28c96a847a95cb8ec8ed6ddd1ca",
"role":"REVIEWER",
"approved":false,
"status":"UNAPPROVED"
},
"previousStatus":"APPROVED"
}
作業が必要な場合
ユーザーがプル リクエストを "作業が必要" とマークします。このペイロードはイベント キー pr:reviewer:needs_work を持ち、次のフィールドを提供します。
パラメーター | 説明 |
---|---|
actor | PR を "作業が必要" とマークしたユーザー。 |
pullrequest | "作業が必要" とマークされたプル リクエストの詳細。 |
参加者 | 変更を加えるユーザーの PR 参加ステータスの詳細。 |
previousStatus | この変更の前の承認の状態。 |
{
"eventKey":"pr:reviewer:needs_work",
"date":"2017-09-19T10:14:47+1000",
"actor":{
"name":"user",
"emailAddress":"user@example.com",
"id":2,
"displayName":"User",
"active":true,
"slug":"user",
"type":"NORMAL"
},
"pullRequest":{
"id":1,
"version":1,
"title":"a new file added",
"description":"A new description, added a user",
"state":"OPEN",
"open":true,
"closed":false,
"createdDate":1505779091796,
"updatedDate":1505779257496,
"fromRef":{
"id":"refs/heads/a-branch",
"displayId":"a-branch",
"latestCommit":"ef8755f06ee4b28c96a847a95cb8ec8ed6ddd1ca",
"repository":{
"slug":"repository",
"id":84,
"name":"repository",
"scmId":"git",
"state":"AVAILABLE",
"statusMessage":"Available",
"forkable":true,
"project":{
"key":"PROJ",
"id":84,
"name":"project",
"public":false,
"type":"NORMAL"
},
"public":false
}
},
"toRef":{
"id":"refs/heads/master",
"displayId":"master",
"latestCommit":"178864a7d521b6f5e720b386b2c2b0ef8563e0dc",
"repository":{
"slug":"repository",
"id":84,
"name":"repository",
"scmId":"git",
"state":"AVAILABLE",
"statusMessage":"Available",
"forkable":true,
"project":{
"key":"PROJ",
"id":84,
"name":"project",
"public":false,
"type":"NORMAL"
},
"public":false
}
},
"locked":false,
"author":{
"user":{
"name":"admin",
"emailAddress":"admin@example.com",
"id":1,
"displayName":"Administrator",
"active":true,
"slug":"admin",
"type":"NORMAL"
},
"role":"AUTHOR",
"approved":false,
"status":"UNAPPROVED"
},
"reviewers":[
{
"user":{
"name":"user",
"emailAddress":"user@example.com",
"id":2,
"displayName":"User",
"active":true,
"slug":"user",
"type":"NORMAL"
},
"lastReviewedCommit":"ef8755f06ee4b28c96a847a95cb8ec8ed6ddd1ca",
"role":"REVIEWER",
"approved":false,
"status":"NEEDS_WORK"
}
],
"participants":[
]
},
"participant":{
"user":{
"name":"user",
"emailAddress":"user@example.com",
"id":2,
"displayName":"User",
"active":true,
"slug":"user",
"type":"NORMAL"
},
"lastReviewedCommit":"ef8755f06ee4b28c96a847a95cb8ec8ed6ddd1ca",
"role":"REVIEWER",
"approved":false,
"status":"NEEDS_WORK"
},
"previousStatus":"UNAPPROVED"
}
マージ
A user merges a pull request for a repository. This payload, with an event key of pr:merged
, provides the following fields:
パラメーター | 説明 |
---|---|
actor | プル リクエストをマージしたユーザー。 |
pullrequest | マージされたプル リクエストの詳細。 |
{
"eventKey":"pr:merged",
"date":"2017-09-19T10:39:36+1000",
"actor":{
"name":"user",
"emailAddress":"user@example.com",
"id":2,
"displayName":"User",
"active":true,
"slug":"user",
"type":"NORMAL"
},
"pullRequest":{
"id":9,
"version":2,
"title":"file edited online with Bitbucket",
"state":"MERGED",
"open":false,
"closed":true,
"createdDate":1505781560908,
"updatedDate":1505781576361,
"closedDate":1505781576361,
"fromRef":{
"id":"refs/heads/admin/file-1505781548644",
"displayId":"admin/file-1505781548644",
"latestCommit":"45f9690c928915a5e1c4366d5ee1985eea03f05d",
"repository":{
"slug":"repository",
"id":84,
"name":"repository",
"scmId":"git",
"state":"AVAILABLE",
"statusMessage":"Available",
"forkable":true,
"project":{
"key":"PROJ",
"id":84,
"name":"project",
"public":false,
"type":"NORMAL"
},
"public":false
}
},
"toRef":{
"id":"refs/heads/master",
"displayId":"master",
"latestCommit":"8d2ad38c918fa6943859fca2176c89ea98b92a21",
"repository":{
"slug":"repository",
"id":84,
"name":"repository",
"scmId":"git",
"state":"AVAILABLE",
"statusMessage":"Available",
"forkable":true,
"project":{
"key":"PROJ",
"id":84,
"name":"project",
"public":false,
"type":"NORMAL"
},
"public":false
}
},
"locked":false,
"author":{
"user":{
"name":"admin",
"emailAddress":"admin@example.com",
"id":1,
"displayName":"Administrator",
"active":true,
"slug":"admin",
"type":"NORMAL"
},
"role":"AUTHOR",
"approved":false,
"status":"UNAPPROVED"
},
"reviewers":[
],
"participants":[
{
"user":{
"name":"user",
"emailAddress":"user@example.com",
"id":2,
"displayName":"User",
"active":true,
"slug":"user",
"type":"NORMAL"
},
"role":"PARTICIPANT",
"approved":false,
"status":"UNAPPROVED"
}
],
"properties":{
"mergeCommit":{
"displayId":"7e48f426f0a",
"id":"7e48f426f0a6e47c5b5e862c31be6ca965f82c9c"
}
},
}
}
却下
ユーザーによるリポジトリでのプル リクエストの却下です。このペイロードには pr:declined
のイベント キーが含まれており、次のフィールドが提供されます。
パラメーター | 説明 |
---|---|
actor | プル リクエストを却下したユーザー。 |
pullrequest | 却下されたプル リクエストの詳細。 |
{
"eventKey":"pr:declined",
"date":"2017-09-19T11:14:43+1000",
"actor":{
"name":"admin",
"emailAddress":"admin@example.com",
"id":1,
"displayName":"Administrator",
"active":true,
"slug":"admin",
"type":"NORMAL"
},
"pullRequest":{
"id":10,
"version":2,
"title":"Commit message",
"state":"DECLINED",
"open":false,
"closed":true,
"createdDate":1505783668760,
"updatedDate":1505783683969,
"closedDate":1505783683969,
"fromRef":{
"id":"refs/heads/decline-me",
"displayId":"decline-me",
"latestCommit":"2d9fb6b9a46eafb1dcef7b008d1a429d45ca742c",
"repository":{
"slug":"repository",
"id":84,
"name":"repository",
"scmId":"git",
"state":"AVAILABLE",
"statusMessage":"Available",
"forkable":true,
"project":{
"key":"PROJ",
"id":84,
"name":"project",
"public":false,
"type":"NORMAL"
},
"public":false
}
},
"toRef":{
"id":"refs/heads/master",
"displayId":"master",
"latestCommit":"7e48f426f0a6e47c5b5e862c31be6ca965f82c9c",
"repository":{
"slug":"repository",
"id":84,
"name":"repository",
"scmId":"git",
"state":"AVAILABLE",
"statusMessage":"Available",
"forkable":true,
"project":{
"key":"PROJ",
"id":84,
"name":"project",
"public":false,
"type":"NORMAL"
},
"public":false
}
},
"locked":false,
"author":{
"user":{
"name":"admin",
"emailAddress":"admin@example.com",
"id":1,
"displayName":"Administrator",
"active":true,
"slug":"admin",
"type":"NORMAL"
},
"role":"AUTHOR",
"approved":false,
"status":"UNAPPROVED"
},
"reviewers":[
{
"user":{
"name":"user",
"emailAddress":"user@example.com",
"id":2,
"displayName":"User",
"active":true,
"slug":"user",
"type":"NORMAL"
},
"role":"REVIEWER",
"approved":false,
"status":"UNAPPROVED"
}
],
"participants":[
]
}
}
Deleted
A user deletes a pull request for a repository. This payload, with an event key of pr:deleted
, provides the following fields:
パラメーター | 説明 |
---|---|
actor | プル リクエストを削除したユーザー。 |
pullrequest | 削除されたプル リクエストの詳細。 |
{
"eventKey":"pr:deleted",
"date":"2017-09-19T11:16:17+1000",
"actor":{
"name":"admin",
"emailAddress":"admin@example.com",
"id":1,
"displayName":"Administrator",
"active":true,
"slug":"admin",
"type":"NORMAL"
},
"pullRequest":{
"id":10,
"version":3,
"title":"Commit message",
"state":"OPEN",
"open":true,
"closed":false,
"createdDate":1505783668760,
"updatedDate":1505783750704,
"fromRef":{
"id":"refs/heads/decline-me",
"displayId":"decline-me",
"latestCommit":"2d9fb6b9a46eafb1dcef7b008d1a429d45ca742c",
"repository":{
"slug":"repository",
"id":84,
"name":"repository",
"scmId":"git",
"state":"AVAILABLE",
"statusMessage":"Available",
"forkable":true,
"project":{
"key":"PROJ",
"id":84,
"name":"project",
"public":false,
"type":"NORMAL"
},
"public":false
}
},
"toRef":{
"id":"refs/heads/master",
"displayId":"master",
"latestCommit":"7e48f426f0a6e47c5b5e862c31be6ca965f82c9c",
"repository":{
"slug":"repository",
"id":84,
"name":"repository",
"scmId":"git",
"state":"AVAILABLE",
"statusMessage":"Available",
"forkable":true,
"project":{
"key":"PROJ",
"id":84,
"name":"project",
"public":false,
"type":"NORMAL"
},
"public":false
}
},
"locked":false,
"author":{
"user":{
"name":"admin",
"emailAddress":"admin@example.com",
"id":1,
"displayName":"Administrator",
"active":true,
"slug":"admin",
"type":"NORMAL"
},
"role":"AUTHOR",
"approved":false,
"status":"UNAPPROVED"
},
"reviewers":[
{
"user":{
"name":"user",
"emailAddress":"user@example.com",
"id":2,
"displayName":"User",
"active":true,
"slug":"user",
"type":"NORMAL"
},
"role":"REVIEWER",
"approved":false,
"status":"UNAPPROVED"
}
],
"participants":[
]
}
}
コメント追加時
ユーザーによるプル リクエストへのコメント追加です。このペイロードには pr:comment:added
のイベント キーが含まれており、次のフィールドが提供されます。
パラメーター | 説明 |
---|---|
actor | コメントを作成したユーザー。 |
pullrequest | コメントが追加されたプル リクエスト。 |
comment | 作成されたコメント。 |
commentParentId | 親コメントの ID (存在する場合)。 |
{
"eventKey":"pr:comment:added",
"date":"2017-09-19T11:21:06+1000",
"actor":{
"name":"admin",
"emailAddress":"admin@example.com",
"id":1,
"displayName":"Administrator",
"active":true,
"slug":"admin",
"type":"NORMAL"
},
"pullRequest":{
"id":11,
"version":1,
"title":"A cool PR",
"state":"OPEN",
"open":true,
"closed":false,
"createdDate":1505783860548,
"updatedDate":1505783878981,
"fromRef":{
"id":"refs/heads/comment-pr",
"displayId":"comment-pr",
"latestCommit":"ddc19f786996396d57e17c8f6d1d05d00318ad10",
"repository":{
"slug":"repository",
"id":84,
"name":"repository",
"scmId":"git",
"state":"AVAILABLE",
"statusMessage":"Available",
"forkable":true,
"project":{
"key":"PROJ",
"id":84,
"name":"project",
"public":false,
"type":"NORMAL"
},
"public":false
}
},
"toRef":{
"id":"refs/heads/master",
"displayId":"master",
"latestCommit":"7e48f426f0a6e47c5b5e862c31be6ca965f82c9c",
"repository":{
"slug":"repository",
"id":84,
"name":"repository",
"scmId":"git",
"state":"AVAILABLE",
"statusMessage":"Available",
"forkable":true,
"project":{
"key":"PROJ",
"id":84,
"name":"project",
"public":false,
"type":"NORMAL"
},
"public":false
}
},
"locked":false,
"author":{
"user":{
"name":"admin",
"emailAddress":"admin@example.com",
"id":1,
"displayName":"Administrator",
"active":true,
"slug":"admin",
"type":"NORMAL"
},
"role":"AUTHOR",
"approved":false,
"status":"UNAPPROVED"
},
"reviewers":[
],
"participants":[
]
},
"comment":{
"properties":{
"repositoryId":84
},
"id":62,
"version":0,
"text":"I am a PR comment",
"author":{
"name":"admin",
"emailAddress":"admin@example.com",
"id":1,
"displayName":"Administrator",
"active":true,
"slug":"admin",
"type":"NORMAL"
},
"createdDate":1505784066751,
"updatedDate":1505784066751,
"comments":[
],
"tasks":[
]
},
"commentParentId":43
}
コメント編集時
このペイロードには pr:comment:edited
のイベント キーが含まれており、次のフィールドが提供されます。
パラメーター | 説明 |
---|---|
actor | コメントを編集したユーザー。 |
pullrequest | コメントが存在するプル リクエスト。 |
comment | 編集されたコメント。 |
commentParentId | 親コメントの ID (存在する場合)。 |
previousComment | 以前のコメントのテキスト。 |
{
"eventKey":"pr:comment:edited",
"date":"2017-09-19T11:24:19+1000",
"actor":{
"name":"admin",
"emailAddress":"admin@example.com",
"id":1,
"displayName":"Administrator",
"active":true,
"slug":"admin",
"type":"NORMAL"
},
"pullRequest":{
"id":11,
"version":1,
"title":"A cool PR",
"state":"OPEN",
"open":true,
"closed":false,
"createdDate":1505783860548,
"updatedDate":1505783878981,
"fromRef":{
"id":"refs/heads/comment-pr",
"displayId":"comment-pr",
"latestCommit":"ddc19f786996396d57e17c8f6d1d05d00318ad10",
"repository":{
"slug":"repository",
"id":84,
"name":"repository",
"scmId":"git",
"state":"AVAILABLE",
"statusMessage":"Available",
"forkable":true,
"project":{
"key":"PROJ",
"id":84,
"name":"project",
"public":false,
"type":"NORMAL"
},
"public":false
}
},
"toRef":{
"id":"refs/heads/master",
"displayId":"master",
"latestCommit":"7e48f426f0a6e47c5b5e862c31be6ca965f82c9c",
"repository":{
"slug":"repository",
"id":84,
"name":"repository",
"scmId":"git",
"state":"AVAILABLE",
"statusMessage":"Available",
"forkable":true,
"project":{
"key":"PROJ",
"id":84,
"name":"project",
"public":false,
"type":"NORMAL"
},
"public":false
}
},
"locked":false,
"author":{
"user":{
"name":"admin",
"emailAddress":"admin@example.com",
"id":1,
"displayName":"Administrator",
"active":true,
"slug":"admin",
"type":"NORMAL"
},
"role":"AUTHOR",
"approved":false,
"status":"UNAPPROVED"
},
"reviewers":[
],
"participants":[
]
},
"comment":{
"properties":{
"repositoryId":84
},
"id":62,
"version":1,
"text":"I am a PR comment that was edited",
"author":{
"name":"admin",
"emailAddress":"admin@example.com",
"id":1,
"displayName":"Administrator",
"active":true,
"slug":"admin",
"type":"NORMAL"
},
"createdDate":1505784066751,
"updatedDate":1505784259446,
"comments":[
],
"tasks":[
]
},
"commentParentId":43,
"previousComment":"I am a PR comment"
}
コメントの削除
A user deletes a comment on a pull request. This payload, with an event key of pr:comment:deleted
, provides the following fields:
パラメーター | 説明 |
---|---|
actor | コメントを削除したユーザー。 |
pullrequest | コメントが存在したプル リクエスト。 |
comment | 削除されたコメント。 |
commentParentId | 親コメントの ID (存在する場合)。 |
{
"eventKey":"pr:comment:deleted",
"date":"2017-09-19T11:25:47+1000",
"actor":{
"name":"admin",
"emailAddress":"admin@example.com",
"id":1,
"displayName":"Administrator",
"active":true,
"slug":"admin",
"type":"NORMAL"
},
"pullRequest":{
"id":11,
"version":1,
"title":"A cool PR",
"state":"OPEN",
"open":true,
"closed":false,
"createdDate":1505783860548,
"updatedDate":1505783878981,
"fromRef":{
"id":"refs/heads/comment-pr",
"displayId":"comment-pr",
"latestCommit":"ddc19f786996396d57e17c8f6d1d05d00318ad10",
"repository":{
"slug":"repository",
"id":84,
"name":"repository",
"scmId":"git",
"state":"AVAILABLE",
"statusMessage":"Available",
"forkable":true,
"project":{
"key":"PROJ",
"id":84,
"name":"project",
"public":false,
"type":"NORMAL"
},
"public":false
}
},
"toRef":{
"id":"refs/heads/master",
"displayId":"master",
"latestCommit":"7e48f426f0a6e47c5b5e862c31be6ca965f82c9c",
"repository":{
"slug":"repository",
"id":84,
"name":"repository",
"scmId":"git",
"state":"AVAILABLE",
"statusMessage":"Available",
"forkable":true,
"project":{
"key":"PROJ",
"id":84,
"name":"project",
"public":false,
"type":"NORMAL"
},
"public":false
}
},
"locked":false,
"author":{
"user":{
"name":"admin",
"emailAddress":"admin@example.com",
"id":1,
"displayName":"Administrator",
"active":true,
"slug":"admin",
"type":"NORMAL"
},
"role":"AUTHOR",
"approved":false,
"status":"UNAPPROVED"
},
"reviewers":[
],
"participants":[
]
},
"comment":{
"id":62,
"version":1,
"text":"I am a PR comment that was edited",
"author":{
"name":"admin",
"emailAddress":"admin@example.com",
"id":1,
"displayName":"Administrator",
"active":true,
"slug":"admin",
"type":"NORMAL"
},
"createdDate":1505784066751,
"updatedDate":1505784259446,
"comments":[
],
"tasks":[
]
},
"commentParentId":43
}
関連コンテンツ
- 関連コンテンツがありません