イベント ペイロード

このページの内容

Still need help?

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

コミュニティへの質問

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

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

また、ホワイトリストに追加する Bitbucket Cloud IP アドレスもご確認ください。

 

次のペイロードには5 つの一般的なエンティティ タイプである、UserRepositoryIssueComment、および Pull Request が含まれています。これらは、ペイロードが表示されるすべての場所で一貫して表示されます。たとえば、repo:push ペイロード actor プロパティは、イベントのユーザーを表します。共通エンティティ セクションには、これらのエンティティの例が記載されています。

HTTP ヘッダー

すべてのイベント ペイロードには次の HTTP ヘッダーがあります。

HTTP ヘッダー 説明
X-Event-Key Webhook をトリガーするイベントのイベント キー (例: repo:push)。
X-Hook-UUID イベントがトリガーする Webhook の UUID。Webhook の UUID の詳細については、「Webhook リソース」を参照してください。
X-Request-UUID リクエストの UUID。
X-Attempt-Number Bitbucket がペイロードの送信を試みた回数。最初のリクエストの後、以前の試行が失敗した場合、Bitbucket はさらに 2 回ペイロードの送信を試みます。試行回数には、[リクエストの再送] ボタンから実行したすべてのユーザーの操作も含まれます。

リポジトリ イベント

リポジトリで発生する次のイベント用に Webhook を作成できます。

プッシュ

ユーザーは 1 つ以上のコミットをリポジトリにプッシュします。このペイロードはイベント キーが repo:push となり、次のフィールドを提供します。

パラメーター 説明
actor コミットをプッシュしたユーザー。Owner エンティティの例を参照してください
リポジトリ コミットがあるリポジトリ。Repository エンティティの例を参照してください。
push

プッシュの詳細 (changes プロパティを含む)。このプロパティには、プッシュが更新したすべての references を含む配列と、次のプロパティが含まれます。

  • new: プッシュ後の参照状態に関する情報を含むオブジェクト。ブランチが削除されると、newnull になります。new には以下のプロパティが含まれます。
    • type: 変更の参照タイプ。
      • Git リポジトリの場合は branch または tag
      • Mercurial の場合は named_branchbookmark または tag
    • name: ブランチ、タグ、名前付きブランチ、またなブックマークの名前。
    • target: プッシュ後の最新のコミットの詳細。
    • links: API (self および commits) および Bitbucket (html) のリファレンスへのリンク。
  • oldプッシュ前のリファレンスの状態に関する情報を含むオブジェクト。ブランチが作成されると、old は null になります。old には以下のプロパティが含まれます。
    • type : 変更の参照タイプ:
      • Git リポジトリの場合は branchtag、または annotated_ tag
      • Mercurial リポジトリの場合は named_branch または bookmark
    • nameブランチ、タグ、名前付きブランチ、またなブックマークの名前。
    • target: プッシュ前の最新のコミットの詳細。
    • links: API ( self および commits ) および Bitbucket ( html ) のリファレンスへのリンク。
  • links Bitbucket (html)、API (commits)、および diff 形式 (diff) の変更へのリンク。
  • createdtrue または false。リファレンスが新しいかどうかを示します。
  • closedtrue または false。リファレンスが古いかどうかを示します。
  • forcedtrue または false。プッシュが強制されたかどうかを示します。
  • commits: そのリファレンスにプッシュされた最新のコミット (最大 5 つ) を含む配列。コミットが 5 件よりも多いプッシュの配列は切り捨てられ、truncated プロパティで示されます。配列には、新しいコミットに加えて次のコミットも含まれます。
    • そのリファレンスにプッシュされていないコミット - リファレンスが最近作成された場合、リポジトリへプッシュされたが、この特定のリファレンスにはプッシュされていないコミットがある可能性があります。この場合、配列には、このような以前プッシュしたコミットも含まれます。たとえば、多数のコミットがある master ブランチから新しいフィーチャー ブランチを作成し、そこに 1 件のコミットをプッシュすると、ペイロードの配列には、5 件のコミット (すべてがそのフィーチャー ブランチにとって新しいコミット) が含まれます。これらのコミットには、先ほど行った 1 つのコミットと、master ブランチの最新コミット 4 件が含まれます。
    • 強制的にプッシュされたコミット - リベースの後に強制プッシュを実行すると、古いリファレンスのコミットはすべて新しいリファレンス内のコミットに置き換えられます。その結果、配列には新しいリファレンスのコミット部分が含まれるようになります。配列には、リベースまたは強制プッシュの際に削除されたコミットは含まれません。
  • truncated: true または false。Bitbucket がこのペイロードの commits 配列を切り捨てたかどうかを表示します。5 件よりも多くコミットがプッシュされると、配列は切り捨てられます。その場合、commits 配列には、最新 5 件のコミットのみが含まれます。
repo:push payload
{    
  "actor": Owner,
  "repository": Repository,
  "push": {
    "changes": [
      {
        "new": {
          "type": "branch",
          "name": "name-of-branch",
          "target": {
            "type": "commit",
            "hash": "709d658dc5b6d6afcd46049c2f332ee3f515a67d",
            "author": User,
            "message": "new commit message\n",
            "date": "2015-06-09T03:34:49+00:00",
            "parents": [
              {
                "type": "commit",
                "hash": "1e65c05c1d5171631d92438a13901ca7dae9618c",
                "links": {
                  "self": {
                    "href": "https://api.bitbucket.org/2.0/repositories/user_name/repo_name/commit/8cbbd65829c7ad834a97841e0defc965718036a0"
},
                  "html": {
                    "href": "https://bitbucket.org/user_name/repo_name/commits/8cbbd65829c7ad834a97841e0defc965718036a0"
                  }
                }
              }
            ],
            "links": {
              "self": {
                "href": "https://api.bitbucket.org/2.0/repositories/user_name/repo_name/commit/c4b2b7914156a878aa7c9da452a09fb50c2091f2"
},
              "html": {
                "href": "https://bitbucket.org/user_name/repo_name/commits/c4b2b7914156a878aa7c9da452a09fb50c2091f2"
              }
            }
          },
          "links": {
            "self": {
              "href": "https://api.bitbucket.org/2.0/repositories/user_name/repo_name/refs/branches/master"
},
            "commits": {
              "href": "https://api.bitbucket.org/2.0/repositories/user_name/repo_name/commits/master"
},
            "html": {
              "href": "https://bitbucket.org/user_name/repo_name/branch/master"
            }
          }
        },
        "old": {
          "type": "branch",
          "name": "name-of-branch",
          "target": {
            "type": "commit",
            "hash": "1e65c05c1d5171631d92438a13901ca7dae9618c",
            "author": User,
            "message": "old commit message\n",
            "date": "2015-06-08T21:34:56+00:00",
            "parents": [
              {
                "type": "commit",
                "hash": "e0d0c2041e09746be5ce4b55067d5a8e3098c843",
                "links": {
                  "self": {
                    "href": "https://api.bitbucket.org/2.0/repositories/user_name/repo_name/commit/9c4a3452da3bc4f37af5a6bb9c784246f44406f7"
},
                  "html": {
                    "href": "https://bitbucket.org/user_name/repo_name/commits/9c4a3452da3bc4f37af5a6bb9c784246f44406f7"
                  }
                }
              }
            ],
            "links": {
              "self": {
                "href": "https://api.bitbucket.org/2.0/repositories/user_name/repo_name/commit/b99ea6dad8f416e57c5ca78c1ccef590600d841b"
},
              "html": {
                "href": "https://bitbucket.org/user_name/repo_name/commits/b99ea6dad8f416e57c5ca78c1ccef590600d841b"
              }
            }
          },
          "links": {
            "self": {
              "href": "https://api.bitbucket.org/2.0/repositories/user_name/repo_name/refs/branches/master"
},
            "commits": {
              "href": "https://api.bitbucket.org/2.0/repositories/user_name/repo_name/commits/master"
},
            "html": {
              "href": "https://bitbucket.org/user_name/repo_name/branch/master"
            }
          }
        },
        "links": {
          "html": {
            "href": "https://bitbucket.org/user_name/repo_name/branches/compare/c4b2b7914156a878aa7c9da452a09fb50c2091f2..b99ea6dad8f416e57c5ca78c1ccef590600d841b"
          },
          "diff": {
            "href": "https://api.bitbucket.org/2.0/repositories/user_name/repo_name/diff/c4b2b7914156a878aa7c9da452a09fb50c2091f2..b99ea6dad8f416e57c5ca78c1ccef590600d841b"
          },
          "commits": {
            "href": "https://api.bitbucket.org/2.0/repositories/user_name/repo_name/commits?include=c4b2b7914156a878aa7c9da452a09fb50c2091f2&exclude=b99ea6dad8f416e57c5ca78c1ccef590600d841b"
          }
        },
        "created": false,
        "forced": false,
        "closed": false,
        "commits": [
          {
            "hash": "03f4a7270240708834de475bcf21532d6134777e",
            "type": "commit",
            "message": "commit message\n",
            "author": User,
            "links": {
              "self": {
                "href": "https://api.bitbucket.org/2.0/repositories/user/repo/commit/03f4a7270240708834de475bcf21532d6134777e"
              },
              "html": {
                "href": "https://bitbucket.org/user/repo/commits/03f4a7270240708834de475bcf21532d6134777e"
              }
            }
          }
        ],
        "truncated": false
      }
    ]
  }
}

フォーク

ユーザーはリポジトリをフォークします。イベント キーが repo:fork となり、次のフィールドを提供します。

パラメーター 説明
actor リポジトリをフォークするユーザー。このユーザーはフォークの所有者でもありますOwner エンティティの例を参照してください
リポジトリ フォークされた元のリポジトリ。Repository エンティティの例を参照してください。
fork

フォークの結果として生成された新しいリポジトリ。Repository エンティティの例を参照してください。

repo:fork
{
"actor": Owner,
  "repository": Repository,
  "fork": Repository
}

更新済み

ユーザーは、NameDescriptionWebsite、または Language フィールド (リポジトリ設定の [リポジトリの詳細] ページ) を更新します。このペイロード (イベント キーが repo:updated ) は、次のフィールドを提供します。

パラメーター 説明
actor 更新を行ったユーザー。Owner エンティティの例を参照してください。
リポジトリ 更新されたリポジトリ。Repository エンティティの例を参照してください。
変更

変更の詳細 (新しい設定と以前の設定内容を含む)。ペイロードには、値が変更されたプロパティのみが含まれます。

  • name: リポジトリの新しい (new) 名前と古い (old) 名前。
  • website: リポジトリの新しい (new) Web サイトと古い (old) Web サイト。
  • language: リポジトリの新しい (new) 言語と古い (old) 言語。
  • links: リポジトリのアバター (avatar)、API のリポジトリ (self)、および Bitbucket のリポジトリ (html) の新しい (new) リンクと古い (old) リンク。
  • description: リポジトリの新しい (new) 説明と古い (old) 説明。
  • full_name: リポジトリの新しい (new) フルネームと古い (old) フルネーム。これには、チームまたはユーザーのアカウント名、スラッシュ (/)、およびリポジトリ名が含まれます。
repo:updated payload
{
"actor": Owner,
"repository": Repository,
"changes": {
"name": {
      "new": "repository",
      "old": "repository_name"
    }
    "website": {
      "new": "http://www.example.com/",
      "old": ""
    }
"language": {
      "new": "java",
      "old": ""
    }
    "links": {
"new": {
        "avatar": {
"href": "https://bitbucket.org/teamawesome/repository/avatar/32/"
        },
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/teamawesome/repository"
}
        "html": {
          "href": "https://bitbucket.org/teamawesome/repository"
        }
      },
      "old": {
        "avatar": {
          "href": "https://bitbucket.org/teamawesome/repository_name/avatar/32/"
        },
        "self": {
          "href": "https://api.bitbucket.org/2.0/repositories/teamawesome/repository_name"
        },
        "html": {
          "href": "https://bitbucket.org/teamawesome/repository_name"
        }
      }
},
    "description": {
      "new": "This is a better description.",
      "old": "This is a description."
    }
    "full_name": {
      "new": "teamawesome/repository",
      "old": "teamawesome/repository_name"
    }
}
}

転送

A repository transfer is accepted. This with an event key of repo:transfer, provides the following fields:

パラメーター 説明
actor
The user who transferred the repository. See the Owner entity sample .
リポジトリ
The repository that was transferred. See the Repository entity sample .
previous_owner
The previous owner of the repository. See the Owner entity sample .
repo:transfer payload
{
"actor": Owner,
"repository": Repository,
"previous_owner": Owner
}


作成したコメントのコミット

A user comments on a commit in a repository. This payload, with an event key of repo:commit_comment_created, provides the following fields:

パラメーター 説明
actor The user who comments on the commit. See the Owner entity sample.
コメント The comment created. See the Comment entity sample.
リポジトリ The repository with the commit. See the Repository entity sample.
commit

The details of the commit, including the hash.

repo:commit_comment_created payload
{
"actor": Owner,
"comment": Comment,
"repository": Repository,
"commit": {
"hash": "d3022fc0ca3d65c7f6654eea129d6bf0cf0ee08e"
}
}

ビルド ステータスの作成

A build system, CI tool, or another vendor recognizes that a user recently pushed a commit and updates the commit with its status. This payload, with an event key of repo:commit_status_created, provides the following fields:

パラメーター 説明
actor The user who made the commit. See the Owner entity sample .
リポジトリ The repository with the commit. See the Repository entity sample.
commit_status

The details of the commit status, which includes the following properties:

  • name: The name of the commit status.
  • description : The description of the commit status.
  • state: The commit status, which is either INPROGRESS, SUCCESSFUL, or FAILED.
  • key: The key that the system or vendor provides to distinguish the status from other statuses associated with the same commit.
  • url: The URL to the vendor or system that produces the status.
  • type :   The type of commit status. Currently, Bitbucket can only associate commit statuses with a build, so the only supported type is build.
  • created_on: The date and time (in ISO 8601 format) the commit status was created. 
  • updated_on: The date and time (in ISO 8601 format) the commit status was last updated.
  • links: Links to representations of the commit and commit status in the API or on Bitbucket.
repo:commit_status_created payload
{
"actor": Owner,
"repository": Repository,
"commit_status": {
"name": "Unit Tests (Python)",
"description": "Build started",
"state": "INPROGRESS",
"key": "mybuildtool",
"url": "https://my-build-tool.com/builds/MY-PROJECT/BUILD-777",
"type": "build",
"created_on": "2015-11-19T20:37:35.547563+00:00",
"updated_on": "2015-11-19T20:37:35.547563+00:00",
    "links": {
"commit": {
"href": "http://api.bitbucket.org/2.0/repositories/tk/test/commit/9fec847784abb10b2fa567ee63b85bd238955d0e"
},
"self": {
"href": "http://api.bitbucket.org/2.0/repositories/tk/test/commit/9fec847784abb10b2fa567ee63b85bd238955d0e/statuses/build/mybuildtool"
}
}
}
}

ビルド ステータスの更新

A build system, CI tool, or another vendor recognizes that a commit has a new status and updates the commit with its status. This payload, with an event key of repo:commit_status_updated, provides the following fields:

パラメーター 説明
actor The user who made the commit. See the Owner entity sample.
リポジトリ The repository with the commit. See the Repository entity sample.
commit_status

The details of the commit status, which includes the following properties:

  • name: The name of the commit status.
  • description: The description of the commit status.
  • state: The commit status, which is either INPROGRESS, SUCCESSFUL, or FAILED.
  • key: The key that the system or vendor provides to distinguish the status from other statuses associated with the same commit.
  • url: The URL to the vendor or system that produces the status.
  • type: The type of commit status. Currently, Bitbucket can only associate commit statuses with a build, so the only supported type is build.
  • created_on: The date and time (in ISO 8601 format) the commit status was created. 
  • updated_on: The date and time (in ISO 8601 format) the commit status was last updated.
  • links: Links to representations of the commit and commit status in the API or on Bitbucket.
repo:commit_status_updated payload
{
"actor": Owner,
"repository": Repository,
"commit_status": {
"name": "Unit Tests (Python)",
"description": "All tests passed",
"state": "SUCCESSFUL",
"key": "mybuildtool",
"url": "https://my-build-tool.com/builds/MY-PROJECT/BUILD-792",
"type": "build",
"created_on": "2015-11-19T20:37:35.547563+00:00",
"updated_on": "2015-11-20T08:01:16.433108+00:00",
    "links": {
"commit": {
"href": "http://api.bitbucket.org/2.0/repositories/tk/test/commit/9fec847784abb10b2fa567ee63b85bd238955d0e"
},
"self": {
"href": "http://api.bitbucket.org/2.0/repositories/tk/test/commit/9fec847784abb10b2fa567ee63b85bd238955d0e/statuses/build/mybuildtool"
}
}
}
}

課題のイベント

You can create webhooks for the following events that occur on an issue.

作成済み

A user creates an issue for a repository. This payload, with an event key of issue:created, provides the following fields:

パラメーター 説明
actor The user who created the issue. See the Owner entity sample.
課題 The issue the user created. See the Issue entity sample.
リポジトリ The repository with the issue. See the Repository entity sample.
issue:created payload
{
"actor": Owner,
"issue": Issue,
"repository": Repository
}

更新済み

A user updated an issue for a repository. This payload, with an event key of issue:updated, provides the following fields:

パラメーター 説明
actor The user who created the issue. See the Owner entity sample.
課題 The issue the user created. See the Issue entity sample.
リポジトリ The repository with the issue. See the Repository entity sample.
コメント The comment added about the update to the issue. See the Comment entity sample.
変更

The details of the changes to the issue, which includes the following properties:

  • old: The previous value for an issue field.
  • new: The new value for an issue field.
issue:updated payload
{
"actor": Owner,
"issue": Issue,
"repository": Repository,
  "comment": Comment,
  "changes": {
    "status": {
      "old": "open",
      "new": "on hold"
    }
  }
}

コメントの作成

A user comments on an issue associated with a repository. This payload, with an event key of issue:comment_created, provides the following fields:

パラメーター 説明
actor The user who comments on the issue. See the Owner entity sample.
リポジトリ The repository with the issue. See the Repository entity sample.
課題 The issue created. See the Issue entity sample.
コメント

The comment created. See the Comment entity sample.

issue:comment_created payload
{
  "actor": Owner,
"repository": Repository,
"issue": Issue,
"comment": Comment
}

プル リクエスト イベント

You can create webhooks for the following events that occur on a pull request.

作成済み

A user creates a pull request for a repository. This payload, with an event key of pullrequest:created, provides the following fields:

パラメーター 説明
actor The user who creates the pull request. See the Owner entity sample.
pullrequest The new pull request. See the Pull Request entity sample.
リポジトリ A representation of the repository with the issue. See the Repository entity sample.
pullrequest:created payload
{
"actor": Owner,
"pullrequest": PullRequest,
"repository": Repository
}

更新済み

A user updates a pull request for a repository. This payload, with an event key of pullrequest:updated, provides the following fields:

パラメーター 説明
actor The user who updates the pull request. See the Owner entity sample.
pullrequest The updated pull request. See the Pull Request entity sample.
リポジトリ The repository with the pull request. See the Repository entity sample.
pullrequest:updated payload
{
"actor": Owner,
"pullrequest": PullRequest,
"repository": Repository
}

承認

A user approves a pull request for a repository. This payload, with an event key of pullrequest:approved, provides the following fields:

パラメーター 説明
actor The user who approves the pull request. See the Owner entity sample.
pullrequest The approved pull request. See the Pull Request entity sample.
リポジトリ The repository with the pull request. See the Repository entity sample.
approval

The details of the approval, including the following properties:

  • date: When the approval was created.
  • user: The user who created the approval.
pullrequest:approved payload
{
"actor": Owner,
"pullrequest": PullRequest,
"repository": Repository,
"approval": {
"date": "2015-04-06T16:34:59.195330+00:00",
"user": User
}
}

承認の取り消し

A user removes an approval from a pull request for a repository. This payload, with an event key of pullrequest:unapproved, provides the following fields:

パラメーター 説明
actor The user who removes the approval. See the Owner entity sample.
pullrequest The pull request with the removed approval. See the Pull Request entity sample.
リポジトリ A representation of the repository with the pull request. See the Repository entity sample.
approval

The details of the approval, including the following properties:

  • date: When the approval was created.
  • user: The user who created the approval.
pullrequest:unapproved payload
{
"actor": Owner,
"pullrequest": PullRequest,
"repository": Repository,
"approval": {
"date": "2015-04-06T16:34:59.195330+00:00",
"user": User
}
}

マージ

A user merges a pull request for a repository. This payload, with an event key of pullrequest:fulfilled, provides the following fields:

パラメーター 説明
actor The user who merges the pull request. See the Owner entity sample.
pullrequest The merged pull request. See the Pull Request entity sample.
リポジトリ The repository with the pull request. See the Repository entity sample.
pullrequest:fulfilled payload
{
"actor": Owner,
"pullrequest": PullRequest,
"repository": Repository
}

却下

A user declines a pull request for a repository. This payload, with an event key of pullrequest:rejected, provides the following fields:

パラメーター 説明
actor The user who declined the pull request. See the Owner entity sample.
pullrequest The declined pull request. See the Pull Request entity sample.
リポジトリ The repository with the pull request. See the Repository entity sample.
pullrequest:rejected payload
{
"actor": Owner,
"pullrequest": PullRequest,
"repository": Repository
}

コメントの作成

A user comments on a pull request. This payload, with an event key of pullrequest:comment_created, provides the following fields:

パラメーター 説明
actor The user who comments on the pull request. See the Owner entity sample.
リポジトリ The repository with the pull request. See the Repository entity sample.
プルリクエスト The pull request with the comment. See the Pull Request entity sample.
コメント

The comment created. See the Comment entity sample.

pullrequest:comment_created payload
{
  "actor": Owner,
"repository": Repository,
"pullrequest": PullRequest,
"comment": Comment
}

コメントの更新

A user updates a comment on a pull request. If a user updates the same comment with not much time in between, Bitbucket only sends the event request the first time the comment is updated. However, if some time passes and that user updates the comment again, Bitbucket sends the event request a second time.

This payload, with an event key of pullrequest:comment_updated, provides the following fields:

パラメーター 説明
actor The user who updates the comment on the pull request. See the Owner entity sample.
リポジトリ The repository with the pull request. See the Repository entity sample.
プルリクエスト The pull request with the comment. See the Pull Request entity sample.
コメント

The comment updated. See the Comment entity sample.

pullrequest:comment_updated payload
{
  "actor": Owner,
"repository": Repository,
"pullrequest": PullRequest,
"comment": Comment
}

コメントの削除

A user deletes a comment on a pull request. This payload, with an event key of pullrequest:comment_deleted, provides the following fields:

パラメーター 説明
actor The user who deletes the comment on the pull request. See the Owner entity sample.
リポジトリ The repository with the pull request. See the Repository entity sample.
プルリクエスト The pull request with the comment. See the Pull Request entity sample.
コメント

The comment deleted. See the Comment entity sample.

pullrequest:comment_deleted payload
{
  "actor": Owner,
"repository": Repository,
"pullrequest": PullRequest,
"comment": Comment
}

Common entities for event payloads

This section includes examples of how payloads represent users, repositories, issues, comments, or pull requests.

所有者

The Owner in event payloads. In addition to the following fields, the user entity may include other fields as well.

パラメーター 説明
タイプ The account type: user or team.
ユーザ名 The username or team ID.
display_name The Full name of the user or the Team name that displays in Bitbucket.
uuid The universally unique identifier of the user or team.

リンク

Links to representations of the user or team in the API or on Bitbucket.
User property
{
  "type": "user",
  "username": "emmap1",
  "display_name": "Emma",
  "uuid": "{a54f16da-24e9-4d7f-a3a7-b1ba2cd98aa3}",
  "links": {
    "self": {
      "href": "https://api.bitbucket.org/api/2.0/users/emmap1"
    },
    "html": {
      "href": "https://api.bitbucket.org/emmap1"
    },
    "avatar": {
      "href": "https://bitbucket-api-assetroot.s3.amazonaws.com/c/photos/2015/Feb/26/3613917261-0-emmap1-avatar_avatar.png"
    }
  }
},

リポジトリ

The Repository in event payloads. In addition to the following fields, the repository entity may include other fields as well.

パラメーター 説明
タイプ The property type. In this case, repository .
名前 The name of the repository.
full_name The username or team name where the repository is located and the name the user.
uuid The universally unique identifier of the repository.
リンク Links to representations of the repository in the API or on Bitbucket.
プロジェクト The project that contains the repository (if one does). See the Project entity sample.
Web サイト The URL to the repository's website when the code is hosted for a specific website.
所有者 The user or team that owns the repository. See the Owner entity sample .
scm The type repository: Git (git) or Mercurial (hg).
is_private true or false to indicate whether the repository is private.
Repository property
{
  "type": "repository",
  "links": {
    "self": {
      "href": "https://api.bitbucket.org/api/2.0/repositories/bitbucket/bitbucket"
    },
    "html": {
      "href": "https://api.bitbucket.org/bitbucket/bitbucket"
    },
    "avatar": {
      "href": "https://api-staging-assetroot.s3.amazonaws.com/c/photos/2014/Aug/01/bitbucket-logo-2629490769-3_avatar.png"
    }
  },
  "uuid": "{673a6070-3421-46c9-9d48-90745f7bfe8e}",
  "project": Project,
  "full_name": "team_name/repo_name",
  "name": "repo_name",
  "website": "https://mywebsite.com/",
  "owner": Owner,
  "scm": "git",
  "is_private": true
},

プロジェクト

The Project in event payloads. In addition to the following fields, the project entity may include other fields as well.

パラメーター 説明
タイプ The property type. In this case, project .
名前 The Name of the project.
uuid The universally unique identifier of the user or team.
リンク Links to representations of the project's avatar or the project on Bitbucket.
鍵 (キー) The Key of the project.
Project property
{
  "type": "project",
  "project": "Untitled project",
  "uuid": "{3b7898dc-6891-4225-ae60-24613bb83080}",
  "links": {
    "html": {
      "href": "https://bitbucket.org/account/user/teamawesome/projects/proj"
    },
    "avatar": {
      "href": "https://bitbucket.org/account/user/teamawesome/projects/proj/avatar/32"
    }
  },
  "key": "proj"
},

課題

The Issue in event payloads. In addition to the following fields, the issue entity may include other fields as well.

パラメーター 説明
ID The id number of the issue.
component(コンポーネント) The component of the issue.
タイトル The title of the issue.

content

The description of the issue.

  • raw: the raw text as the user typed it
  • markup: the markup language used
  • html: the rendered HTML version of the markup
優先度 The priority category of the issue.
状態 The status of the issue.
タイプ The type of issue.
マイルストーン The milestone reached with the issue.
VERSION (バージョン) The version number associated with the issue.
created_on The date and time (in ISO 8601 format) the issue was created. 
updated_on The date and time (in ISO 8601 format) the issue was last updated. 
リンク Links to representations of the issue in the API or on Bitbucket.
Issue property
{
   "id" 1 ,
   "component" "component" ,
   "title" "Issue title" ,
   "content" : {
     "raw" "Issue description" ,
     "html" "<p>Issue description</p>" ,
     "markup" "markdown"
   },
   "priority" "trivial|minor|major|critical|blocker" ,
   "state" "new|open|on hold|resolved|duplicate|invalid|wontfix|closed" ,
   "type" "bug|enhancement|proposal|task" ,
   "milestone" : {  "name" "milestone 1"  },
   "version" : {  "name" "version 1"  },
   "created_on" "2015-04-06T15:23:38.179678+00:00" ,
   "updated_on" "2015-04-06T15:23:38.179678+00:00" ,
  "links": {
    "self": {
      "href": "https://api.bitbucket.org/api/2.0/issues/issue_id"
    },
    "html": {
      "href": "https://api.bitbucket.org/issue_id"
    }
  }
}

コメント

The Comment in event payloads. In addition to the following fields, the comment entity may include other fields as well.

パラメーター 説明
ID The id number of the comment.
Parent (親) The id number of the comment's parent comment.
content

The actual comment. It contains the following nested elements:

  • raw: the raw text as the user typed it
  • markup: the markup language used
  • html: the rendered HTML version of the markup

inline

An indication of whether the comment is an inline code comment. It contains the following nested elements:

  • to: the line number of the new version in the diff that the comment was made on (the "green" line). null if the line does not exist in the new version
  • from: the line number of the old version in the diff that the comment was made on (the "red" line). null if the line does not exist in the old version
  • path: the name of the file the comment was made on

Inline comments also have an additional link (rel: "code") in the links section that points to the raw file diff.

created_on The date and time (in ISO 8601 format) the issue was created. 
updated_on The date and time (in ISO 8601 format) the issue was last updated.
リンク Links to representations of the comment in the API or on Bitbucket.
Comment property
{
   "id" 17 ,
   "parent" : {  "id" 16  },
   "content" : {
     "raw" "Comment text" ,
     "html" "<p>Comment text</p>" ,
     "markup" "markdown" ,
   },
   "inline" : {
     "path" "path/to/file" ,
     "from" null ,
     "to" 10
   },
   "created_on" "2015-04-06T16:52:29.982346+00:00" ,
   "updated_on" "2015-04-06T16:52:29.983730+00:00",
  "links": {
    "self": {
      "href": "https://api.bitbucket.org/api/2.0/comments/comment_id"
    },
    "html": {
      "href": "https://api.bitbucket.org/comment_id"
    }
  }
}

Pull request

The Pull Request in event payloads. In addition to the following fields, the pull request entity may include other fields as well.

パラメーター 説明
ID The id number that identifies the pull request.
タイトル The name of the pull request.
説明 The description of the pull request.

状態

The status of the pull request.
作成者 The creator of the pull request.
ソース Information about the source of the pull request. It contains the following nested elements:
  • branch: the name of the branch
  • commit: the SHA1 of the branch head
  • repository: the representation of the repository with the branch
destination Information about the destination of the pull request. It contains the following nested elements:
  • branch: the name of the branch
  • commit: the SHA1 of the branch head
  • repository: the representation of the repository with the branch
merge_commit The SHA1 of the commit when the pull request merges.
参加者 A list of participants part of the pull request.
reviewers A list of reviewers on the pull request. You only need to provide the username element of the user object.
close_source_branch true or false to indicate whether Bitbucket should close the source branch after the pull requests is successfully merged. Only use this parameter when the source and destination are in the same repo.
closed_by The user who closes the pull request, either by merging or declining it.
理由 The reason the pull request is declined (if necessary).
created_on The date and time (in ISO 8601 format) the pull request was created. 
updated_on The date and time (in ISO 8601 format) the pull request was last updated.
リンク Links to representations of the pull request in the API or on Bitbucket.
Pull Request property
{
   "id" 1 ,
   "title" "Title of pull request" ,
   "description" "Description of pull request" ,
   "state" "OPEN|MERGED|DECLINED" ,
   "author" : User,
   "source" : {
     "branch" : {  "name" "branch2"  },
     "commit" : {  "hash" "d3022fc0ca3d"  },
     "repository" : Repository
   },
   "destination" : {
     "branch" : {  "name" "master"  },
     "commit" : {  "hash" "ce5965ddd289"  },
     "repository" : Repository
   },
   "merge_commit" : {  "hash" "764413d85e29"  },
   "participants" : [User],
   "reviewers" : [User],
   "close_source_branch" true ,
   "closed_by" : User,
   "reason" "reason for declining the PR (if applicable)" ,
   "created_on" "2015-04-06T15:23:38.179678+00:00" ,
   "updated_on" "2015-04-06T15:23:38.205705+00:00",
  "links": {
    "self": {
      "href": "https://api.bitbucket.org/api/2.0/pullrequests/pullrequest_id"
    },
    "html": {
      "href": "https://api.bitbucket.org/pullrequest_id"
    }
  }
}
最終更新日 2017 年 7 月 13 日

この翻訳に満足しましたか?

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