PHP Bitbucket API

Simple Bitbucket API wrapper for PHP

Repository issues

Provides functionality for interacting with an issue tracker. Authentication is necesary to access private issue tracker, to get more detailed information, to create and to update an issue.

Prepare:

// @see: https://bitbucket.org/account/user/<username or team>/api
$oauth_params = array(
    'client_id'         => 'aaa',
    'client_secret'     => 'bbb'
);

$issue = new \Bitbucket\API\Repositories\Issues();
$issue->getClient()->addListener(
    new \Bitbucket\API\Http\Listener\OAuth2Listener($oauth_params)
);

Fetch a list of issues:

$issue->all($account_name, $repo_slug);

Fetch a single issue:

$issue->get($account_name, $repo_slug, 3);

Fetch 5 issues that contains word bug in title:

$issue->all($account_name, $repo_slug, array(
    'limit' => 5,
    'start' => 0,
    'search' => 'bug'
));

Add a new issue:

$issue->create($account_name, $repo_slug, array(
    'title'     => 'dummy title',
    'content'   => 'dummy content',
    'kind'      => 'proposal',
    'priority'  => 'blocker'
));

Update an existing issue:

$issue->update($account_name, $repo_slug, 5, array(
    'title' => 'dummy title (edited)'
));

Delete issue:

$issue->delete($account_name, $repo_slug, 5);