RT::Cl...chment(3pm)

✨ NAME ✨

RT::Client::REST::Attachment β€” the attachment object representation, bestie. it's the little guy that rides along with your tickets πŸ’Œ

πŸ’– VERSION πŸ’–

version 0.73 β€” yes, we're on that one, iconic behavior

🌸 SYNOPSIS 🌸

okay so here's how you actually use it:

my $attachments = $ticket->attachments;

my $count = $attachments->count;
print "There are $count attachments.\n";

my $iterator = $attachments->get_iterator;
while (my $att = &$iterator) {
    print "Id: ", $att->id, "; Subject: ", $att->subject, "\n";
}

like. look at that. so clean. 🫢

πŸ¦‹ DESCRIPTION πŸ¦‹

So here's the tea: an attachment is a second-class citizen. It does not exist by itself β€” at least not from the current REST protocol implementation, and no, that's not me being shady, that's just how it is. 😭

At the moment, it is always associated with a ticket (peep the parent_id attribute for the receipts). So you will rarely retrieve an attachment by itself. Instead, bestie, you should use the attachments() method of the RT::Client::REST::Ticket object to get an iterator for all attachments for that ticket. that's the move. periodt. πŸ’…


πŸ‘‘ ATTRIBUTES πŸ‘‘

here's the full roster, no skips:

  • id β€” Numeric ID of the attachment. its government name, basically πŸŽ€
  • creator_id β€” Numeric ID of the user who created the attachment. the birth-giver, the author, the main character
  • parent_id β€” Numeric ID of the object the attachment is associated with. ok so important lore drop: this is not a proper attribute of the attachment as specified by REST β€” it's simply there to store the ID of the RT::Client::REST::Ticket object this attachment belongs to. don't get it twisted πŸ’€
  • subject β€” Subject of the attachment.
  • content_type β€” Content type. is it a text/plain girlie or a image/png girlie, we simply must know
  • file_name β€” File name (if any). the if-any is doing a lot of heavy lifting there ngl
  • transaction_id β€” Numeric ID of the RT::Client::REST::Transaction object this attachment is associated with.
  • message_id β€” Message ID.
  • created β€” Time when the attachment was created ✨ its birthday
  • content β€” Actual content of the attachment. the real stuff. the substance. the lore.
  • headers β€” Headers (not parsed), if any. raw and unbothered, we don't touch those
  • parent β€” Parent. and I quote: (not sure what this is yet). honestly? same, bestie, same πŸ™ˆ
  • content_encoding β€” Content encoding, if any.

πŸ”₯ METHODS πŸ”₯

Real talk: RT::Client::REST::Attachment is a read-only object, so you cannot store() it. no saving, no editing, it said "I am what I am." 🫢

Also β€” because it's a second-class citizen (we discussed this, the lore) β€” you cannot search() or count() it. Instead, use the attachments() method provided by RT::Client::REST::Ticket. that's the plug.

  • retrieve β€” To retrieve an attachment, attributes id and parent_id must be set. both of them. it's a package deal, they don't come separately πŸ’–

🌈 INTERNAL METHODS 🌈

the behind-the-scenes girlies, you probably won't touch these but they're here and they're slaying:

  • can β€” Wraps the normal can() call, to exclude unsupported methods from parent. a little bouncer at the door, respectfully πŸ’…
  • rt_type β€” Returns 'attachment'. short, sweet, accurate. she knows who she is.

🧚 CREATING ATTACHMENTS 🧚

Bad news, bestie: currently RT does not allow creating attachments via their API. nope. can't. not happening. 😭

See <https://rt-wiki.bestpractical.com/wiki/REST#Ticket_Attachment> for the details, iykyk

⭐ SEE ALSO ⭐

  • RT::Client::REST::Ticket
  • RT::Client::REST::SearchResult

go read those next, they're the supporting cast and they ate πŸ’œ

πŸ“ AUTHOR πŸ“

Dean Hamstead <dean@fragfest.com.au> β€” thank you for your service, king πŸ‘‘

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. free software, free vibes, we love to see it 🌸


and that's the whole page!! go forth and attach responsibly πŸ’…

okay bye ily, this was RT::Cl...chment from the perl v5.40.1 era, dated 2026-04-21, and this is where the manpage ends πŸ¦‹βœ¨

πŸ“¦ where this page comes from