[rt-users] RT-Mailgate hack to remove quoted replies

Tom Lahti toml at bitstatement.net
Mon Apr 6 17:14:37 EDT 2009


Gary Greene wrote:
> There are a number of interesting mods that I've noted he's working on
> that I'm interested in. (For instance the scrip changes to enforce only
> requesters can change the ticket's status, etc.

Actually, I accomplished that with just scrips.  And then I convinced
ownership it was a bad idea, because it meant that people working on tickets
could no longer use their ticket list as a "to-do" list, and it wasn't
really needed because a requestor can always re-open a resolved ticket by
just replying to the email.

They were actually trying to solve another issue where a requestor was not
notified when a ticket was resolved.  That's what happens when owners try to
play systems analyst without telling the engineers what the actual problem
is and just try to ask for what they think the best solution would be instead.

However, if you're dying for it all you have to do it apply a scrip to
condition "On Resolve" with action prep:

return 1;

and action cleanup:

return 1 if $self->TransactionObj->IsInbound;
$self->TicketObj->_Set(Field => 'Status', Value => 'open', RecordTransaction
=> 0);
return 1;

And then, when someone other than a requestor resolves a ticket, the cleanup
code sets it back to open. The IsInbound method of the Transaction object
returns true if the transaction was generated by a requestor.

Then you just do the same thing in reverse for conditions that generate
'resolved' emails so you aren't sending out an email when a non-requestor
tries to resolve.  I tried playing around with template code to send
different emails whether it was a requestor or not (Dear requestor, XXX
would like you to resolve ticket YYY), but Text::Template parsing is rather
limited and it never worked the way I wanted it to.  Notably, you can't have
a conditional (like an 'if' statement) span blocks.


-- 
-- ============================
   Tom Lahti
   BIT Statement LLC

   (425)251-0833 x 117
   http://www.bitstatement.net/
-- ============================



More information about the rt-users mailing list