Original request in owner change template

Is it possible (maybe by help of TransactionBatchStage) to include text
of original request in owner change template, similar to including last
comment on ticket resolve?

Marko Cupać

Is it possible (maybe by help of TransactionBatchStage) to include text
of original request in owner change template, similar to including last
comment on ticket resolve?

You don’t need batch stage for that. You just need first transaction of
type Create.


my $txns = $ticket->Transactions;
$txns->Limit( FIELD => ‘Type’, VALUE => ‘Create’ );
my $txn = $txns->First;

Marko Cupać

Best regards, Ruslan.

This is what I get in the log when I put that into my template:

[Fri Apr 26 12:46:26 2013] [error]: Template parsing error: Can’t call
method “Transactions” on an undefined value at template line 5.

Marko CupaćOn Fri, 26 Apr 2013 16:17:03 +0400 Ruslan Zakirov ruz@bestpractical.com wrote:

On Fri, Apr 26, 2013 at 2:57 PM, Marko Cupać marko.cupac@mimar.rs wrote:

Is it possible (maybe by help of TransactionBatchStage) to include
text of original request in owner change template, similar to
including last comment on ticket resolve?

You don’t need batch stage for that. You just need first transaction
of type Create.


my $txns = $ticket->Transactions;
$txns->Limit( FIELD => ‘Type’, VALUE => ‘Create’ );
my $txn = $txns->First;

Marko Cupać

Pardon my stupid, I am no programmer. I modified it and now it works:

{
my $original_request;
my $Transactions = $Ticket->Transactions;

$Transactions->Limit( FIELD => ‘Type’, VALUE => ‘Create’ );
my $RequestObj = $Transactions->First;

$original_request = $RequestObj->Content;

$original_request;
}

Marko CupaćOn Fri, 26 Apr 2013 14:52:50 +0200 Marko Cupać marko.cupac@mimar.rs wrote:

This is what I get in the log when I put that into my template:

[Fri Apr 26 12:46:26 2013] [error]: Template parsing error: Can’t call
method “Transactions” on an undefined value at template line 5.