GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  RT::CLIENT::REST::TICKET (3)

.ds Aq ’

NAME

RT::Client::REST::Ticket -- this object represents a ticket.

CONTENTS

SYNOPSIS



  my $rt = RT::Client::REST->new(server => $ENV{RTSERVER});

  # Create a new ticket:
  my $ticket = RT::Client::REST::Ticket->new(
    rt => $rt,
    queue => "General",
    subject => $subject,
  )->store(text => "This is the initial text of the ticket");
  print "Created a new ticket, ID ", $ticket->id, "\n";

  # Update
  my $ticket = RT::Client::REST::Ticket->new(
    rt  => $rt,
    id  => $id,
    priority => 10,
  )->store;

  # Retrieve
  my $ticket => RT::Client::REST::Ticket->new(
    rt => $rt,
    id => $id,
  )->retrieve;

  unless ($ticket->owner eq $me) {
    $ticket->steal;     # Give me more work!
  }



DESCRIPTION

<B>RT::Client::REST::TicketB> is based on RT::Client::REST::Object. The representation allows one to retrieve, edit, comment on, and create tickets in RT.

ATTRIBUTES

<B>idB> This is the numeric ID of the ticket.
<B>queueB> This is the <B>nameB> of the queue (not numeric id).
<B>ownerB> Username of the owner.
<B>creatorB> Username of RT user who created the ticket.
<B>subjectB> Subject of the ticket.
<B>statusB> The status is usually one of the following: new, open, resolved, stalled, rejected, and deleted. However, custom RT installations sometimes add their own statuses.
<B>priorityB> Ticket priority. Usually a numeric value.
<B>initial_priorityB>
<B>final_priorityB>
<B>requestorB> This is the attribute for setting the requestor on ticket creation. If you use requestors to do this in 3.8, the recipient may not receive an autoreply from RT because the ticket is initially created as the user your REST session is connected as.

It is a list attribute (for explanation of list attributes, see <B>LIST ATTRIBUTE PROPERTIESB> in RT::Client::REST::Object).

<B>requestorsB> This contains e-mail addresses of the requestors.

It is a list attribute (for explanation of list attributes, see <B>LIST ATTRIBUTE PROPERTIESB> in RT::Client::REST::Object).

<B>ccB> A list of e-mail addresses used to notify people of ’correspond’ actions.
<B>admin_ccB> A list of e-mail addresses used to notify people of all actions performed on a ticket.
<B>createdB> Time at which ticket was created. Note that this is an immutable field and therefore the value cannot be changed..
<B>startsB>
<B>startedB>
<B>dueB>
<B>resolvedB>
<B>toldB>
<B>time_estimatedB>
<B>time_workedB>
<B>time_leftB>
<B>last_updatedB>

    Attributes storing a time

The attributes which store a time stamp have an additional accessor with the suffix _datetime (eg., resolved_datetime). This allows you can get and set the stored value as a DateTime object. Internally, it is converted into the date-time string which RT uses, which is assumed to be in UTC.

DB METHODS

For full explanation of these, please see <B>DB METHODSB> in RT::Client::REST::Object documentation.
<B>retrieveB> Retrieve RT ticket from database.
<B>store ([text => B>$text<B>])B> Create or update the ticket. When creating a new ticket, optional ’text’ parameter can be supplied to set the initial text of the ticket.
<B>searchB> Search for tickets that meet specific conditions.

TICKET-SPECIFIC METHODS

<B>commentB> (message => $message, %opts) Comment on this ticket with message $message. %opts is a list of key-value pairs as follows:
<B>attachmentsB> List of filenames (an array reference) that should be attached to the ticket along with the comment.
<B>ccB> List of e-mail addresses to send carbon copies to (an array reference).
<B>bccB> List of e-mail addresses to send blind carbon copies to (an array reference).
<B>correspondB> (message => $message, %opts) Add correspondence to the ticket. Takes exactly the same arguments as the <B>commentB> method above.
<B>attachmentsB> Get attachments associated with this ticket. What is returned is an object of type RT::Client::REST::SearchResult which can then be used to get at objects of type RT::Client::REST::Attachment.
<B>transactionsB> Get transactions associated with this ticket. Optionally, you can specify exactly what types of transactions you want listed, for example:



  my $result = $ticket->transactions(type => [qw(Comment Correspond)]);



Please reference RT::Client::REST documentation for the full list of valid transaction types.

Return value is an object of type RT::Client::REST::SearchResult which can then be used to iterate over transaction objects (RT::Client::REST::Transaction).

<B>takeB> Take this ticket. If you already the owner of this ticket, RT::Client::REST::Object::NoopOperationException will be thrown.
<B>untakeB> Untake this ticket. If Nobody is already the owner of this ticket, RT::Client::REST::Object::NoopOperationException will be thrown.
<B>stealB> Steal this ticket. If you already the owner of this ticket, RT::Client::REST::Object::NoopOperationException will be thrown.

CUSTOM FIELDS

This class inherits ’cf’ method from RT::Client::REST::Object. To create a ticket with a bunch of custom fields, use the following approach:



  RT::Client::REST::Ticket->new(
    rt => $rt,
    # blah blah
    cf => {
      field one => $value1,
      field two => $another_value,
    },
  )->store;



Some more examples:



  # Update a custom field value:
  $ticket->cf(field one => $value1);
  $ticket->store;

  # Get a custom field value:
  my $another value = $ticket->cf(field two);

  # Get a list of tickets custom field names:
  my @custom_fields = $ticket->cf;



INTERNAL METHODS

<B>rt_typeB> Returns ’ticket’.

SEE ALSO

RT::Client::REST, RT::Client::REST::Object, RT::Client::REST::Attachment, RT::Client::REST::SearchResult, RT::Client::REST::Transaction.

AUTHOR

Dmitri Tikhonov <dtikhonov@yahoo.com>

LICENSE

Perl license.
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 RT::CLIENT::REST::TICKET (3) 2015-11-27

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.