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 use requestors to do this in 3.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. πŸ‘‘


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