[rt-users] Template to include All ticket content on resolve

Ruslan Zakirov ruz at bestpractical.com
Mon Jun 6 17:03:10 EDT 2011


Hi,

Check error logs. Increase logging to debug. Add more debugging to the
template. Nobody touched that page for a while. I don't recall
complaints.

On Tue, Jun 7, 2011 at 12:52 AM, Kyle Thomas <kyle at avalontel.com> wrote:
> Yes that is what I used
>
> Can you see my other email I sent
>
> Ok Here is what I found in the old archives
>
>
>
> On resolve it is putting in the "Initial request" content fine but it is not
> including the complete ticket history it only shows
>
> ----------------------------------------------------------------
>
> Complete Ticket History
>
> ----------------------------------------------------------------
>
>
>
> And does not show any of the comments or correspondence in the ticket . Can
> anyone take a look at my code I have under complete ticket history and
> suggest why it is not including the history???
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> Subject: Resolved: {$Ticket->Subject}
>
>
>
> Dear customer,
>
>
>
>
>
>
>
> according to our records your issue regarding
>
>
>
>
>
>
>
> "{$Ticket->Subject()}",
>
>
>
>
>
>
>
> has been resolved in our ticket system.
>
>
>
>
>
> If you have any further questions or concerns, please reply to this
>
>
>
> message to reopen the ticket or email (our email)  to open another ticket.
>
>
>
> Regards,
>
>
>
> Our Name
>
>
>
>
>
> ----------------------------------------------------------------
>
>
>
> Your initial request was
>
>
>
> ----------------------------------------------------------------
>
>
>
>
>
>
>
> {$Ticket->Transactions->First->Content()}
>
>
>
>
>
> ----------------------------------------------------------------
>
> Complete Ticket History
>
> ----------------------------------------------------------------
>
>
>
>
>
>
>
>
>
> {
>
> my $resolved_transaction;
>
> my $resolved_message = "";
>
> my $last_content;
>
> my $Transactions = $Ticket->Transactions;
>
> $Transactions->OrderBy;
>
> $Transactions->GotoFirstItem;
>
> while (my $Transaction = $Transactions->Next) {
>
> if ($Transaction->Type eq 'Correspond') {
>
> $resolved_transaction = $Transaction;
>
> } elsif (!$Transactions->IsLast) {
>
> $resolved_transaction = undef;
>
> }
>
>
>
> if ($resolved_transaction) {
>
>
>
> my $attachments = $resolved_transaction->Attachments;
>
> $attachments->GotoFirstItem;
>
>
>
> while (my $message = $attachments->Next) {
>
> next unless $message->ContentType =~
>
> m!^(text/plain|message|text$)!i;
>
>
>
> my $content = $message->Content;
>
> if ($last_content eq $content) {
>
> $content = undef; }
>
> next unless length $content;
>
> $last_content = $content;
>
>
>
> my $subject = ($message->Subject || $Ticket->Subject);
>
>
>
> my $wrapper = Text::Wrapper->new(columns=>70);
>
> $content = $wrapper->wrap($content);
>
>
>
> $resolved_message .= "Subject: ";
>
> $resolved_message .= $subject;
>
> $resolved_message .= "\n";
>
> $resolved_message .= "From: ";
>
> $resolved_message .= $message->CreatorObj->RealName ." (".$rtname.")";
>
> $resolved_message .= "\n";
>
> $resolved_message .= "Time: ";
>
> $resolved_message .= $message->CreatedObj->AsString;
>
> $resolved_message .= "\n";
>
> $resolved_message .= "\n";
>
> $resolved_message .= "$content\n";
>
> $resolved_message .= "------------------------------------------------\n";
>
> }
>
> }
>
> }
>
> $resolved_message;
>
> }
>
>
> Kyle
>
>
> -----Original Message-----
> From: ruslan.zakirov at gmail.com [mailto:ruslan.zakirov at gmail.com] On Behalf
> Of Ruslan Zakirov
> Sent: Monday, June 06, 2011 4:24 PM
> To: Kyle Thomas
> Cc: rt-users at lists.bestpractical.com
> Subject: Re: [rt-users] Template to include All ticket content on resolve
>
> On Mon, Jun 6, 2011 at 10:06 PM, Kyle Thomas <kyle at avalontel.com> wrote:
>> Can anyone share with me a template that will include all of the tickets
>> contents/transactions when resolved? The default resolve template has a
> URL
>> link but I do not want my customers going to the URL and I would just like
>> to include the entire ticket history contents on resolve
>
> Take a look at:
>
> http://requesttracker.wikia.com/wiki/AddTicketHistoryToMail
>
>
> --
> Best regards, Ruslan.
>
>



-- 
Best regards, Ruslan.



More information about the rt-users mailing list