イベント ペイロード

Bitbucket Server で webhook を管理する

このページの内容

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

イベントに関連付けられた Webhook がある場合、Bitbucket はイベントが発生するたびに Webhook のサーバー URL にイベント リクエストを送信します。このページでは、これらのリクエストの構造について説明します。 

HTTPS エンドポイントに関連付けられた Webhook のイベント ペイロード リクエストを Bitbucket が送信する場合、URL に公的な認証局が署名した有効な SSL 証明書があることを確認してください。

The following payloads contain some of the five common entity types – UserRepository,  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
A unique UUID for each webhook request
X-Event-Key

The event that kicked off this webhook. For example, a repository push will have

repo:refs_changed.

X-Hub-Signature
See Webhook secrets

リポジトリ イベント

リポジトリで発生する次のイベント用に 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
コミットがあるリポジトリ。
変更
The details of the push.
repo:refs_changed payload
{  
  "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:

パラメータ 説明
古い

The details of the old version of the repository.

新規
The defaults of the current version of the repository.
actor

更新を行ったユーザー。

repo:modified payload
{  
  "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
The user who forks the repository. This user is also the owner of the fork.
repository
The new repository.
repository.origin The original repository that was forked.
repo:forked payload
{  
  "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
The user who comments on the commit.
comment
作成されたコメント。
repository
コミットがあるリポジトリ。 
commit
The hash.
repo:comment:added payload
{  
  "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"
}

Commit edit on comment

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
The user who edits the commit.
comment
The comment edited.
previousComment The text of the comment prior to editing.
repository
コミットがあるリポジトリ。 
commit
The hash of the commit.
repo:comment:edited payload
{  
  "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!"
}

Comment deleted on commit

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
The user who deletes the commit.
comment
削除されたコメント。
repository
コミットがあるリポジトリ。 
commit
The hash of the commit.
repo:comment:deleted payload
{  
  "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"
}

プル リクエスト イベント

プル リクエストで発生する次のイベントのために webhook を作成できます。

Opened

パラメータ 説明
actor
The user who created the pull request.
pullrequest
Details of the pull request created.
pr:opened payload
{  
  "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
      ]
    }
  }
}

更新日

パラメータ 説明
actor
The user who created the pull request.
pullrequest
Details of the pull request created.
previousTitle Previous title of the pull request, may not have changed
previousDescription Previous description of pull request, may not have changed
previousTarget Previous target of the pull request, may not have changed
pr:opened payload
{
  "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"
  }
}

Reviewers Updated

パラメータ 説明
actor
The user who created the pull request.
pullrequest
Details of the pull request created.
removedReviewers Users that are no longer reviewers
addedReviewers Users that have been added as reviewers
pr:opened payload
{
  "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
The user which made the approval.
pullrequest
Details of the pull request approved.
参加者
Details of the PR participant status of the user making the change
previousStatus
The state of the approval before this change
pr:reviewer:approved
{  
  "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"
}

Unapproved

ユーザーによるリポジトリでのプル リクエストからの承認の削除です。このペイロードには pr:reviewer:unapproved のイベント キーが含まれており、次のフィールドが提供されます。

パラメータ 説明
actor
The user which removed the approval.
pullrequest
Details of the pull request unapproved.
参加者
Details of the PR participant status of the user making the change
previousStatus
The state of the approval before this change
pr:reveiwer:unapproved payload
{  
  "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"
}

Needs work

A user marks a pull request as needs work. This payload, with an event key of pr:reviewer:needs_work, provides the following fields:

パラメータ 説明
actor
The user which marked the PR as "Needs work".
pullrequest
Details of the pull request marked "Needs work".
参加者
Details of the PR participant status of the user making the change.
previousStatus
The state of the approval before this change.
pr:reviewer:needs_work payload
{  
  "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"
}

マージ

ユーザーによるリポジトリでのプル リクエストのマージです。このペイロードには pullrequest:fulfilled のイベント キーが含まれており、次のフィールドが提供されます。

パラメータ 説明
actor
The user who merged the pull request.
pullrequest
Details of the pull request merged.
pr:merged payload
{  
  "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
Details of the pull request declined.
pr:declined
{  
  "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
The user who deleted the pull request.
pullrequest
Details of the pull request deleted.
pr:deleted
{  
  "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
The user that created the comment.
pullrequest
The pull request comment on.
comment
作成されたコメント。
commentParentId
Id of the parent comment if one exists.
pr:comment:added payload
{  
  "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
The user that edited the comment.
pullrequest
The pull request where the comment exists.
comment
The comment edited.
commentParentId
Id of the parent comment if one exists.
previousComment Text of the previous comment.
pr:comment:edited payload
{  
  "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
The user that deleted the comment.
pullrequest
The pull request where the comment existed.
comment
削除されたコメント。
commentParentId
Id of the parent comment if one exists.
pr:comment:deleted payload
{  
  "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
}
最終更新日 2019 年 4 月 3 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.