[rt-users] RT Query - how to display last comment
Ruslan Zakirov
ruz at bestpractical.com
Mon Dec 13 19:21:50 EST 2010
Hi,
It's absolutly incorrect. It should look close to the following code:
value => sub {
my $txns = $_[0]->Transactions;
$txns->Limit(FIELD => 'Type', VALUE => 'Correspond' );
$txns->OrderBy(
{ FIELD => 'Created', ORDER => 'DESC' },
{ FIELD => 'id', ORDER => 'DESC' },
);
my $txn = $txns->First;
return 'No replies on the ticket' unless $txn;
return $txn->Content;
}
Something along above lines, never tested.
On Mon, Dec 13, 2010 at 10:56 PM, Kenneth Crocker <kfcrocker at lbl.gov> wrote:
> Ruslan,
>
> Would this be the correct code:
>
> Comment => {
> title => 'Comment', # last comment
> attribute => 'Comment',
> value => sub { return $_[0]->TransObj->Id( $_[0]->id
> )->Field('Type')->Value('Comment') }
> },
>
>
> Thanks.
>
> Kenn
> LBNL
>
> On Sun, Dec 12, 2010 at 6:13 AM, Ruslan Zakirov <ruz at bestpractical.com>
> wrote:
>>
>> Hi,
>>
>> If you mean search results and thier format strings then there is no
>> such column map, but it's possible to add. Look at
>> share/html/Elements/RT__Ticket/ColumnMap.
>>
>> On Sat, Dec 11, 2010 at 1:44 AM, Kenneth Crocker <kfcrocker at lbl.gov>
>> wrote:
>> > To List,
>> >
>> > Does anyone know how to get the last comment on a ticket to display in a
>> > Query? I can get it in a template, but it doesn't seem available in a
>> > Query.
>> >
>> > Kenn
>> > LBNL
>> >
>>
>>
>>
>> --
>> Best regards, Ruslan.
>
>
--
Best regards, Ruslan.
More information about the rt-users
mailing list