RT::Cl...Ticket(3pm)
π RT::Cl...Ticket β the manual, but make it make sense π
okay bestie, gather round, because today we're talking about RT::Client::REST::Ticket β the ticket object representation from the User Contributed Perl Documentation crew. yes, that's the manual name, we're being fancy today. π
β¨ NAME β¨
RT::Client::REST::Ticket β ticket object representation. that's it, that's the whole name. iconic behavior honestly. π
πΈ VERSION πΈ
version 0.73 β periodt.
π¦ SYNOPSIS π¦
here's the vibe, verbatim, do not touch my baby:
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!
}
okay the create β update β retrieve β steal pipeline?? main character energy fr fr. that last comment # Give me more work! is me volunteering for a shift i'll regret. π
π DESCRIPTION π
RT::Client::REST::Ticket is based on RT::Client::REST::Object. the representation lets you retrieve, edit, comment on, and create tickets in RT. that's the whole job. lowkey a full little toolkit. π«Ά
π ATTRIBUTES π
idβ the numeric ID of the ticket. numbers only, bestie.queueβ the name of the queue. not the numeric id. i said what i said. πownerβ username of the owner.creatorβ username of the RT user who created the ticket.subjectβ subject of the ticket.statusβ usually one of:"new","open","resolved","stalled","rejected", and"deleted". BUT β and this is important β custom RT installations sometimes add their own statuses, so don't come for me if your install has extra ones. πpriorityβ ticket priority. usually a numeric value.initial_priorityβ listed here, no extra blurb in the source. just vibing.final_priorityβ same, no blurb, just present. β¨requestorβ this is the attribute for setting the requestor on ticket creation. if you userequestorsto do this in3.8, the recipient may not receive an auto-reply from RT, because the ticket is initially created as the user your REST session is connected as. π
it's a list attribute (for explanation of list attributes, see LIST ATTRIBUTE PROPERTIES in RT::Client::REST::Object).
requestorsβ this contains e-mail addresses of the requestors.
it's a list attribute (for explanation of list attributes, see LIST ATTRIBUTE PROPERTIES in RT::Client::REST::Object).
ccβ a list of e-mail addresses used to notify people of'correspond'actions.admin_ccβ a list of e-mail addresses used to notify people of all actions performed on a ticket. all of them. the whole lore. πcreatedβ time at which ticket was created. note that this is an immutable field and therefore the value cannot be changed.. (yes there are two periods, we respect the original.)startsβ listed, no blurb.startedβ listed, no blurb.dueβ listed, no blurb.resolvedβ listed, no blurb.toldβ listed, no blurb.time_estimatedβ listed, no blurb.time_workedβ listed, no blurb.time_leftβ listed, no blurb.last_updatedβ listed, no blurb.
π°οΈ Attributes storing a time π°οΈ
the attributes that store a time stamp get an additional accessor with the suffix _datetime (e.g. "resolved_datetime"). π this means you can get and set the stored value as a DateTime object. internally, it gets converted into the date-time string that RT uses, which is assumed to be in UTC. no cap.
π§ DB METHODS π§
for the full explanation of these, please see "DB METHODS" in the RT::Client::REST::Object documentation. go read it, bestie, i believe in you. π«Ά
retrieveβ retrieve RT ticket from database.store ([text => $text])β create or update the ticket. when creating a new ticket, an optional'text'parameter can be supplied to set the initial text of the ticket.searchβ search for tickets that meet specific conditions.
π TICKET-SPECIFIC METHODS π
π comment (message => $message, %opts)
comment on this ticket with message $message. %opts is a list of key-value pairs as follows:
attachmentsβ list of filenames (an array reference) that should be attached to the ticket along with the comment.ccβ list of e-mail addresses to send carbon copies to (an array reference).bccβ list of e-mail addresses to send blind carbon copies to (an array reference).
π¨ correspond (message => $message, %opts)
add correspondence to the ticket. takes exactly the same arguments as the comment method above. copy-paste queen. β¨
π attachments
get attachments associated with this ticket. what you get back is an object of type RT::Client::REST::SearchResult, which you can then use to get at objects of type RT::Client::REST::Attachment.
π§Ύ transactions
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 the RT::Client::REST documentation for the full list of valid transaction types. π
the 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).
β take
take this ticket. if you're already the owner of this ticket, "RT::Client::REST::Object::NoopOperationException" will be thrown. rude of it, honestly.
π untake
untake this ticket. if Nobody is already the owner of this ticket, "RT::Client::REST::Object::NoopOperationException" will be thrown.
π₯· steal
steal this ticket. if you're already the owner of this ticket, "RT::Client::REST::Object::NoopOperationException" will be thrown.
π CUSTOM FIELDS π
this class inherits the '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 ticket's custom field names:
my @custom_fields = $ticket->cf;
(yes, my $another value β that's what the source says, we do not editorialize, we simply observe and respect. πβ¨)
βοΈ INTERNAL METHODS βοΈ
rt_typeβ returns'ticket'.
π SEE ALSO π
RT::Client::REST, RT::Client::REST::Object, RT::Client::REST::Attachment, RT::Client::REST::SearchResult, RT::Client::REST::Transaction. go read them all, they're the friend group. π«Ά
π AUTHOR π
Dean Hamstead <dean@fragfest.com.au> β thank you king/queen/royalty. π
π COPYRIGHT AND LICENSE π
this software is copyright (c) 2026, 2020 by Dmitri Tikhonov.
this is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
π reminder bestie: the vibes are new, the facts are not. every flag, default, path, exception, number and example above is exactly as it was. no cap. π
and that's the whole page, babe β this was RT::Cl...Ticket(3pm) from perl v5.40.1, dated 2026-04-21. ate and left no crumbs. ππβ¨
π¦ where this page comes from
- ubuntu stonking: librt-client-rest-perl 1:0.73-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms