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 characterparent_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 theRT::Client::REST::Ticketobject this attachment belongs to. don't get it twisted πsubjectβ Subject of the attachment.content_typeβ Content type. is it atext/plaingirlie or aimage/pnggirlie, we simply must knowfile_nameβ File name (if any). the if-any is doing a lot of heavy lifting there ngltransaction_idβ Numeric ID of theRT::Client::REST::Transactionobject this attachment is associated with.message_idβ Message ID.createdβ Time when the attachment was created β¨ its birthdaycontentβ 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 thoseparentβ 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, attributesidandparent_idmust 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 normalcan()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::TicketRT::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 π
π 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. 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
- 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