[rt-users] Where are comments and correspondence held?

Paul Tomblin ptomblin at xcski.com
Tue Nov 6 07:24:38 EST 2012


On Tue, Nov 6, 2012 at 4:58 AM, Tim Cutts <tjrc at sanger.ac.uk> wrote:

> But generally you don't want to do that, and instead you want to use the
> perl API to get at them:
>
> my $attachments = RT::Attachments->new(RT->SystemUser);
> $attachments->LimitByTicket(294774);
> $attachments->LimitNotEmpty;
>

And if you *just* want Comments, say, you can do

    my $attachments = RT::Attachments->new(RT->SystemUser);
    $attachments->LimitByTicket(294774);
    $attachments->Limit(
      ALIAS           => $attachments->TransactionAlias,
      FIELD           => 'Type',
      OPERATOR        => '=',
      VALUE           => 'Comment',
      ENTRYAGGREGATOR => 'OR',
      CASESENSITIVE   => 1
    );

    while (my $attachment = $attachments->Next)
    {

(If there's an easier way to do that, please let me know)

-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20121106/71b79ddb/attachment.htm>


More information about the rt-users mailing list