Displaying history in resloved auto-response

Hello,

I have tried numerous ways of getting the history to display in the
resloved auto-response template can any one assist?

Is anyone doing this?? The boss has asked me and I am trying but don’t
know if it is possible to call the history to be displayed inside the
resolved scrips template?From: Odhiambo Washington [mailto:wash@wananchi.com]
Sent: Saturday, November 09, 2002 3:10 AM
To: Christen R. Pacheco
Subject: Re: [rt-users] displaying history in resloved auto-response

Hello,

I have tried numerous ways of getting the history to display in the
resloved auto-response template can any one assist?

I have this working but not as you mean it. I do not send the whole
history. I only send the “last correspondence”. I was assisted by
some expert in the rt-users list to achieve it. You don’t want to
send the whole history, including comments, do you?

-Wash

Odhiambo Washington wash@wananchi.com “The box said ‘Requires
Wananchi Online Ltd. www.wananchi.com Windows 95, NT, or better,’
Tel: +254 2 313985-9 +254 2 313922 so I installed FreeBSD.”
GSM: +254 72 743223 +254 733 744121 This sig is McQ! :slight_smile:

If you can’t be good, be careful. If you can’t be careful, give me a
call.

Is anyone doing this?? The boss has asked me and I am trying but don’t
know if it is possible to call the history to be displayed inside the
resolved scrips template?

You want something like the following in your template, in addition to
the normal guff:

Hi. My name is ‘An Example Template’. You probably know me from such
famous movies such as… such as… well, they’re not important right now.
What is important is the bits between the ‘{’ and ‘}’ symbols, which is
executed as perl with a few predefined variables.

{ my $have_last=0;
my $retval = undef;
my $diag = undef;
my $newtrans=$Ticket->Transactions;

Use DESC if you want it in reverse order

Use ASC if you want it in arrived order

$newtrans->OrderBy( FIELD => ‘id’, ORDER => ‘DESC’ );

Loop until we run out.

while( (my $thistrans = $newtrans->Next) && ($have_last == 0) ){
$diag .= "TransId: " . $thistrans->id . " Type: " . $thistrans->Type();
# extra line as we word-wrapped
$diag .= “\n”;

# Only dump out correspondence.
next unless( $thistrans->Type() eq 'Correspond' );

# Have this if you only want the last one, comment out if you
# want all of them.
$have_last++;

# If you want a seperator between messages
$retval .= "-------------------------------------------------------";

# Add the content.
$retval .=$thistrans->Content;

}

If you want to print the diag.

$retval = $retval . “\nDIAG: \n” . $diag;

return( $retval );
}

Hi, you’re still in the Template.

This code does work (as given) with Odhiambo, and should work with the
changes suggested if you wish to show all the history. For further
detail, see the /Ticket/Elements/ShowHistory and
/Ticket/Elements/ShowTransaction .

Regards,

                         Bruce Campbell                            RIPE
               Systems/Network Engineer                             NCC
             www.ripe.net - PGP562C8B1B             Operations/Security