Client reference

class codebase.Client(*args, **kwargs)[source]

Codebase API client class that allows some ticket properties to be referenced by name instead of the object ID.

Note that most methods return a generator of results. API requests are lazy, so a request isn’t made until the first result is accessed, and if the results are paginated then additional requests are made only when you access results from subsequent pages.

Most of the Codebase API methods return 20 results per page. Some API methods (such as the API to get all the projects associated with an account) are not paginated and return all results in one page.

create_ticket(project, **kwargs)[source]

Create a new ticket.

See the API documentation on tickets and milestones for details.

create_ticket_note(project, ticket_id, **kwargs)[source]

Create a new note on a ticket in a project.

See the API documentation on updating tickets for details.

use_cache(project, kwargs)[source]

For some ticket classifiers (what Codebase calls organisational objects, such as status, category, etc.), return a new dict with the classifier’s name replaced by the classifier’s ID.

This works by making an API call to get ticket statuses, etc. and caching the results for quick lookup. The cache can be cleared with Client.reset_cache().