<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">Hi Rick,</div><div class=""><br class=""></div><div class="">For the complete history of a ticket you need to first load the tickets transactions and then select those you want to cycle through - then cycle through them and only printing the create and correspond content.</div><div class=""><br class=""></div><div class="">In the template try something like this code block:</div><div class="">{</div><div class="">    # Select which transactions to cycle through</div><div class="">    my $transactions = $Ticket->Transactions;<br class="">    $transactions->Limit( FIELD => 'Type', VALUE => 'Create' );<br class="">    $transactions->Limit( FIELD => 'Type', VALUE => 'Correspond', ENTRYAGGREGATOR => 'OR', OPERATOR => '=' );</div><div class=""><br class=""></div><div class="">    # Build the $content variable up - we'll be concatenating to this string below</div><div class="">    my $content;<br class="">    while (my $transaction = $transactions->Next) {<br class="">        my $attachments = $transaction->Attachments;<br class="">        while (my $attachment = $attachments->Next) {<br class="">            next unless $attachment->ContentType =~ m!^(text/html|text/plain|message|text$)!i;  # skip non-text stuff</div><div class="">            # Only include headers if they are present on the attachment<br class="">            $content .= defined $attachment->GetHeader('From') ? "From: ".$attachment->GetHeader('From')."\n" : "";<br class="">            $content .= defined $attachment->GetHeader('To') ? "To: ".$attachment->GetHeader('To')."\n" : "";<br class="">            $content .= defined $attachment->GetHeader('Subject') ? "Subject: ".$attachment->GetHeader('Subject')."\n\n" : "";</div><div class="">            # Include the content of the attachment<br class="">            $content .= defined $attachment->OriginalContent ? $attachment->OriginalContent : "";<br class="">        }<br class="">    }</div><div class="">    return $content;</div><div class="">}</div><div class=""><br class=""></div><div class="">The above is not really tested code but I know the idea behind it works.</div><div class=""><br class=""></div>You've got me on the attachments.  I'd like to know more about that as well since attaching a file from a past update to a new a ticket update would be awesome.<div class=""><br class=""><div apple-content-edited="true" class="">
<div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Landon Stewart : <a href="mailto:lstewart@iweb.com" class="">lstewart@iweb.com</a></div><div style="color: rgb(0, 0, 0); letter-spacing: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class="">Lead Specialist, Abuse and Security Management<br class="">Spécialiste principal, gestion des abus et sécurité<br class=""><a href="http://iweb.com" class="">http://iweb.com</a> : +1 (888) 909-4932</div></div>
</div>
<br class=""><div><blockquote type="cite" class=""><div class="">On Mar 13, 2015, at 1:58 PM, Rick Zoerner <<a href="mailto:rick.zoerner@cccparts.com" class="">rick.zoerner@cccparts.com</a>> wrote:</div><br class="Apple-interchange-newline"><div class="">Hi,<br class=""><br class="">I have set up an approval process for invoices that is working perfectly up to the paying part. However, to finish it up I have 2 tasks I can't figure out on my own.<br class="">1)   I need to be able to send the entire "History" of the ticket in an email, and,<br class="">2)   Attach any and all attachments from a particular custom field (of a type=attach multiple documents).<br class=""><br class="">So far, for this project, I have:<br class="">   1- created a custom lifecycle using status changes to move a CapEx through stages of authorization, acquisition, approval for payment and payment.<br class="">   2- created custom templates for each status. Each status change triggers an email using a template customized  for that person/stage in the process (i.e. "Manager Approval", "IT Approval", "Finance Approval", "Acquire", "ApproveToPay", "Coding", "Pay").<br class="">   3- set up custom fields in the ticket to hold all the attachments needed during the process in a consistent location. Quotes, invoices, etc.<br class=""><br class="">The history display is particularly important because it is the audit trail of all the approvals. Each approval level is just a drop-down custom field in the ticket (approved/denied). It is the history that shows who flipped it to "Approved" and the date/time stamp of when they did.<br class=""><br class="">It works great for everybody in the sequence except the final stage - paying the invoice(s). <br class="">Finance has to open the ticket, print the web page to capture the history (audit trail), then find the attachments and open/print each of them, then look at the field where coding listed how to book the payable (GL account and dollar amount), etc.<br class=""><br class="">Since I am already sending them an email with a link to the ticket in it when the status changes to "pay"... I would like to include in that email the full history, a couple other custom fields I can capture easily (like the coding, the original justification, etc.), and attach the invoices - one-stop shopping for A/P. I just can't find anything to help me figure out how to call out the entire ticket history.<br class=""><br class="">Thanks in advance to anyone who has a ready answer for this - I'm NOT a programmer at all, so I've spent several days looking through the documentation and only barely able to understand a fraction of it. Please speak to me as to a child - in Perl that would be an overly generous appraisal of my ability.<br class=""><br class="">-Rick <br class=""><br class=""></div></blockquote></div><br class=""></div></body></html>