CannedReplies on Create

The CannedReplies callback has done wonders for our staff with regards
to frequent requests, whether it be for temporary admin rights to
install software updates or when a better computer comes available,
allowing us to notify possible recipients.

The question that has been posed to me (and I have bald spots from
trying this out) is if the CannedReplies can be instituted on ticket
creation, rather than on update.

Any thoughts or ideas to kick me in the right direction?

Drew

We have an OnCreate scrip that looks a fields in the incoming email and if
configured to do so loads the body of an RTFM acticle, sends it to the
requestor and closes the ticket. The article instructs the user to reply to
the ticket if it didn’t answer their question, that way the ticket will be
re-opened for inspection by a human. It has saved us months of work.

-ToddOn 12/14/07, Drew Barnes barnesaw@ucrwcu.rwc.uc.edu wrote:

The CannedReplies callback has done wonders for our staff with regards
to frequent requests, whether it be for temporary admin rights to
install software updates or when a better computer comes available,
allowing us to notify possible recipients.

The question that has been posed to me (and I have bald spots from
trying this out) is if the CannedReplies can be instituted on ticket
creation, rather than on update.

Any thoughts or ideas to kick me in the right direction?

Drew


The rt-users Archives

SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:

If you sign up for a new RT support contract before December 31, we’ll
take
up to 20 percent off the price. This sale won’t last long, so get in touch
today.
Email us at sales@bestpractical.com or call us at +1 617 812 0745.

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

At Friday 12/14/2007 03:15 PM, Drew Barnes wrote:

The CannedReplies callback has done wonders for our staff with regards
to frequent requests, whether it be for temporary admin rights to
install software updates or when a better computer comes available,
allowing us to notify possible recipients.

The question that has been posed to me (and I have bald spots from
trying this out) is if the CannedReplies can be instituted on ticket
creation, rather than on update.

Any thoughts or ideas to kick me in the right direction?

Drew

Drew,

I’m assuming you’re wanting to use this from the ticket Create page.
It won’t work as-is, but it could be easily adapted. The main
difference is that on the Create page, there is no ticket yet, so the
references in the callbacks to ticket obj and ticket id would fail.
Another difference is that Create.html has no callback before the message box.

To adapt (I haven’t tested this!): you can either add a callback
statement into Create.html and put the following code in the
callback file, or put this code directly into Create.html:

Canned reply: <& /Admin/Elements/SelectTemplate, Name => "Canned-Template", Queue => $QueueObj->id &>

You’d also have to modify the second callback
(Callbacks//Elements/MessageBox/Default) to account for the
possibility of no ticket object being present. Also, in templates to
be used in Create.html, you wouldn’t be able to include any ticket fields:

%#
%# Allows use of templates as ‘canned replies’ in update screen.
%# Looks up the template specified, parses it and displays the parsed
%# template content.
%#
% if ($content) {
<% $content %>
% }
<%init>
my $template;
my $trans = new RT::Transaction( $session{‘CurrentUser’} );
my $ticket = new RT::Ticket( $session{‘CurrentUser’} );
my $content = “”;

if ( $ARGS{‘select_template’} ) {
my $template_id = $ARGS{‘Canned-Template’};
if ($template_id) {
$template = RT::Template->new($session{‘CurrentUser’});
$template->Load($template_id);
if ($template->id) {
$TicketObj = LoadTicket($ARGS{‘id’}) if ($ARGS{‘id’} &&
$ARGS{‘id’} ne ‘new’);
$template->Parse(TicketObj => $TicketObj,
TransactionObj => $trans);
$content = $template->MIMEObj->stringify;
}
}

}
</%init>