SYNOPSIS

    my $ticket = Net::Trac::Ticket->new( connection => $trac );
    $ticket->load( 1 );

    print $ticket->summary, "\n";

DESCRIPTION

This class represents a ticket on a remote Trac instance. It provides methods for creating, reading, and updating tickets and their history as well as adding comments and getting attachments. Accept's a timestamp in Trac's somewhat idiosyncratic format and returns a DateTime object

METHODS

new \s-1HASH\s0

Takes a key \*(C`connection\*(C' with a value of a Net::Trac::Connection. Returns an empty ticket object.

load \s-1ID\s0

Loads up the ticket with the specified \s-1ID\s0. Returns the ticket \s-1ID\s0 loaded on success and undef on failure.

load_from_hashref \s-1HASHREF\s0 [\s-1SKIP\s0]

You should never need to use this method yourself. Loads a ticket from a hashref of data, optionally skipping metadata loading (values of \*(C`valid_*\*(C' accessors).

create \s-1HASH\s0

Creates and loads a new ticket with the values specified. Returns undef on failure and the new ticket \s-1ID\s0 on success.

update \s-1HASH\s0

Updates the current ticket with the specified values.

Returns undef on failure, and the \s-1ID\s0 of the current ticket on success.

comment \s-1TEXT\s0

Adds a comment to the current ticket. Returns undef on failure, true on success.

history

Returns a Net::Trac::TicketHistory object for this ticket.

comments

Returns an array or arrayref (depending on context) of history entries which have comments included. This will include history entries representing attachments if they have descriptions.

attach \s-1PARAMHASH\s0

Attaches the specified \*(C`file\*(C' with an optional \*(C`description\*(C'. Returns undef on failure and the new Net::Trac::TicketAttachment object on success.

attachments

Returns an array or arrayref (depending on context) of all the Net::Trac::TicketAttachment objects for this ticket.

ACCESSORS

connection

id

summary

type

status

priority

severity

resolution

owner

reporter

cc

description

keywords

component

milestone

version

created

Returns a DateTime object

last_modified

Returns a DateTime object

basic_statuses

Returns a list of the basic statuses available for a ticket. Others may be defined by the remote Trac instance, but we have no way of easily getting them.

valid_props

Returns a list of the valid properties of a ticket.

add_custom_props

Adds custom properties to valid properties list.

valid_create_props

Returns a list of the valid properties specifiable when creating a ticket.

valid_update_props

Returns a list of the valid updatable properties.

Valid property values

These accessors are loaded from the remote Trac instance with the valid values for the properties upon instantiation of a ticket object.

valid_milestones
valid_types
valid_components
valid_priorities
valid_resolutions - Only loaded when a ticket is loaded.
valid_severities - May not be provided by the Trac instance.

LICENSE

Copyright 2008-2009 Best Practical Solutions.

This package is licensed under the same terms as Perl 5.8.8.