Beanstalk

Code Review Event Resource

This resource represents Events from Cod Review’s History sub-page. Every time something new happens to a Code Review, an Event is created.

List of available events

Beanstalk will create Events automatically when you push new commits to the branch, create comments, assign users, etc. Events are delivered to all Watchers via special code review digest emails.

  1. create: review was requested;
  2. approve: review was approved;
  3. revoke: user reverted his/her approval of the review;
  4. cancel: review was cancelled;
  5. reopen: review was reopened;
  6. assign: User was assigned to the review;
  7. unassign: User was removed from review’s assignees;
  8. merge: review’s target_branch was successfully merged into source_branch;
  9. commit: commit was made to the target_branch (used for Subversion);
  10. push: push was made to the target_branch (used for Git);
  11. comment: Comment was posted;
  12. added_issue: Issue has been created;
  13. resolved_issue: Issue has been marked as resolved.

New format

We are gradually phasing out XML support from our API and this is one of the first resources that are provided only in JSON format. The format was also a bit adjusted compared to other resources: associated objects (like repositories and users) are now embedded into JSON itself, and there are no JSON root elements anymore.

Attributes

id integer Event ID.
name string Name of the event.
created_at datetime Date and time when the event has been created.
revision string Revision number (or Git hash) associated with the event. Optional.
associated_object hash Embedded object association with the event (comment, issue, user, etc.)
type string Type of the object.
id integer ID of the object.
name string User full name. For User type objects only.
login string User login. For User type objects only.
email string User email address. For User type objects only.
author_name string Comment author full name. For Comment type objects only.
author_login string Comment author login. For Comment type objects only.
author_email string Comment author email address. For Comment type objects only.
body string Comment raw content (Markdown source). For Comment type objects only.
rendered_body string Comment rendered content (HTML). For Comment type objects only.
author hash Embedded object of the User who triggered the event.
id integer User ID.
name string User full name.
login string User login.
email string User email address.

Find Events for Code Review

Optional GET parameters:

  • page (integer) — page number for pagination.
  • per_page (integer) — number of elements per page (default 25, maximum 200);
  • order (string) — date order direction. Should be either ASC or DESC (default is DESC);
  • name (string) — only return events that match specified name (see the list of available names at the top of this page).
json http-request
GET /api/{REPOSITORY_ID}/code_reviews/{REVIEW_ID}/events.json

Click to expand…

json http-response
{
  "page": 1,
  "per_page": 25,
  "total_pages": 2,
  "page_entries": 25,
  "total_entries": 36,
  "events": [
    {
      "id": 42,
      "name": "assign",
      "created_at": "2014/11/18 16:22:57 -0500",
      "revision": null,
      "associated_object": {
        "type": "User",
        "id": 1,
        "name": "Ilya Sabanin",
        "login": "ilya",
        "email": "ilya@example.com"
      },
      "author": {
        "id": 1,
        "name": "Ilya Sabanin",
        "login": "ilya",
        "email": "ilya@example.com"
      }
    }
  ]
}