Resolve Ticket Template

Hello…
I’ve posted about this before, and I’ve been scouring the list archives
to no avail. What I would like to do is edit and/or replace the Ticket
Resolved template to include the original request. Some of my users have
been complaining that they get a ticket resolution and become confused
about which ticket the email is referring to. I’ve tried simple things
such as adding {$Transaction->Content()} just to see what it would get
me, but nothing came of that. Any help would be greatly appreciated.

Thanks
Sean

Sean Lutner
Senior Systems & Network Administrator
TechTarget, Inc.
117 Kendrick St, Suite 800
Needham, MA 02494
P: 781-657-1337
F: 781-657-1100
E: sean@techtarget.com W: http://www.techtarget.com

“Imagination is more important than knowledge.” – Albert Einstein

Hello…
I’ve posted about this before, and I’ve been scouring the list archives
to no avail. What I would like to do is edit and/or replace the Ticket
Resolved template to include the original request. Some of my users have
been complaining that they get a ticket resolution and become confused
about which ticket the email is referring to. I’ve tried simple things
such as adding {$Transaction->Content()} just to see what it would get
me, but nothing came of that. Any help would be greatly appreciated.

We learned that clicking the “Reply” or “Comment” link on any message
within the ticket history, then changing the status field on the next
page to “resolved” has the desired affect AND allows you to choose which
of the correspondence/comments on the ticket is appropriate for the
resolution response.

Oh, and we require that the person resolving the ticket actually choose
the most relevant history item and use the “reply” link from it so that
the requestors and CCs will know why their issue was marked resolved.
That’s more a methodology/people management issue, tho.

YMMV.

–j
Jim Meyer, Geek At Large purp@wildbrain.com

Sean Lutner wrote:

I’ve posted about this before, and I’ve been scouring the list archives
to no avail. What I would like to do is edit and/or replace the Ticket
Resolved template to include the original request. Some of my users have
been complaining that they get a ticket resolution and become confused
about which ticket the email is referring to. I’ve tried simple things
such as adding {$Transaction->Content()} just to see what it would get
me, but nothing came of that. Any help would be greatly appreciated.

{$Ticket->Transactions->First->Content()}

Thanks, that seems very straight forward. However, if I put anything
except plain text in my resolved template, mail for resolved templates
stops being sent. Any ideas why that might be?

Thanks
SeanOn Thu, 2002-07-11 at 19:26, Phil Homewood wrote:

Sean Lutner wrote:

I’ve posted about this before, and I’ve been scouring the list archives
to no avail. What I would like to do is edit and/or replace the Ticket
Resolved template to include the original request. Some of my users have
been complaining that they get a ticket resolution and become confused
about which ticket the email is referring to. I’ve tried simple things
such as adding {$Transaction->Content()} just to see what it would get
me, but nothing came of that. Any help would be greatly appreciated.

{$Ticket->Transactions->First->Content()}


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

Have you read the FAQ? The RT FAQ Manager lives at http://fsck.com/rtfm
Sean Lutner
Senior Systems & Network Administrator
TechTarget, Inc.
117 Kendrick St, Suite 800
Needham, MA 02494
P: 781-657-1337
F: 781-657-1100
E: sean@techtarget.com W: http://www.techtarget.com

“Imagination is more important than knowledge.” – Albert Einstein

Thanks, that seems very straight forward. However, if I put anything
except plain text in my resolved template, mail for resolved templates
stops being sent. Any ideas why that might be?

The Templates (when used in most mail-sending Scrips) are really in two
sections;

Headers for the message
	(blank line)
Body of the message

If you want the default RT headers, and just want to change your content
around, you may wish to begin the Template with a blank line, just to be
sure.

( eg, if you’re posting ->Content() in, and it doesn’t begin with a blank
line, RT may interpret it as mail headers; and who knows where the
message will end up. )

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

I think I may be doomed to never be able to edit my Resolved template.
:slight_smile:

I just tried starting the template with a blank line, with the second
line being

{$Ticket->Transactions->First->Content()}

As soon as I changed the template to this, I stopped getting emails.
Also, many of the other stock RT templates don’t start with a blank
line, and have code mixed with text on the same line.

IE - In the autoreply ticket, the first line of the template is Subject:
AutoReply: {$Ticket->Subject}

Once again I’m left baffled, I thought this would be a pretty easy thing
to change. Thanks for the tips thus far.

SeanOn Fri, 2002-07-12 at 09:41, Bruce Campbell wrote:

On 12 Jul 2002, Sean Lutner wrote:

Thanks, that seems very straight forward. However, if I put anything
except plain text in my resolved template, mail for resolved templates
stops being sent. Any ideas why that might be?

The Templates (when used in most mail-sending Scrips) are really in two
sections;

Headers for the message
(blank line)
Body of the message

If you want the default RT headers, and just want to change your content
around, you may wish to begin the Template with a blank line, just to be
sure.

( eg, if you’re posting ->Content() in, and it doesn’t begin with a blank
line, RT may interpret it as mail headers; and who knows where the
message will end up. )


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


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

Have you read the FAQ? The RT FAQ Manager lives at http://fsck.com/rtfm
Sean Lutner
Senior Systems & Network Administrator
TechTarget, Inc.
117 Kendrick St, Suite 800
Needham, MA 02494
P: 781-657-1337
F: 781-657-1100
E: sean@techtarget.com W: http://www.techtarget.com

“Imagination is more important than knowledge.” – Albert Einstein

I think I may be doomed to never be able to edit my Resolved template.
:slight_smile:

I just tried starting the template with a blank line, with the second
line being

{$Ticket->Transactions->First->Content()}

As soon as I changed the template to this, I stopped getting emails.

Odd, I just tried it too as it is a nice thing to have and it worked
perfectly, so the variable name is fine.

Andy.

I just tried starting the template with a blank line, with the second
line being

{$Ticket->Transactions->First->Content()}

As soon as I changed the template to this, I stopped getting emails.
Also, many of the other stock RT templates don’t start with a blank
line, and have code mixed with text on the same line.

Are you sure that you have Text::Template installed correctly? Try
running rt-mailgate from the command line, something like:

cat email-message | /path/to/rt-mailgate --whatever-options-you-need

And see what happens.

(darren)

The smart way to keep people passive and obedient is to strictly limit
the spectrum of acceptable opinion, but allow very lively debate
within that spectrum.
– Noam Chomsky

{$Ticket->Transactions->First->Content()}

As soon as I changed the template to this, I stopped getting emails.

Odd, I just tried it too as it is a nice thing to have and it worked
perfectly, so the variable name is fine.

Andy.

I tried this also and it is working. Here is exactly what I have in my global->templates->7/Resolved:

According to our records, your request,
{$Ticket->Transactions->First->Content()}
has been resolved. If you have any
further questions or concerns, please respond to this message.

Thanks,
The Support team.

this works as advertised.

I tried putting your exact template in to test and now I get the
following error in my rt logs.

error: couldn’t parse head; error near:

I’m not sure why. I have a leading blank line in the template. I’ve
tried it without a leading blank line.

This is the only template causing me issues. All the others, even ones
I’ve edited are performaing as expected. Now it seems that no matter
what I enter into the template when I edit it, mail stops being sent.On Fri, 2002-07-12 at 10:39, Seth wrote:

On Fri, 12 Jul 2002 15:03:46 +0100 “Andy Coates” andy@bribed.net wrote:

{$Ticket->Transactions->First->Content()}

As soon as I changed the template to this, I stopped getting emails.

Odd, I just tried it too as it is a nice thing to have and it worked
perfectly, so the variable name is fine.

Andy.

I tried this also and it is working. Here is exactly what I have in my global->templates->7/Resolved:


Subject: Ticket Resolved

According to our records, your request,

{$Ticket->Transactions->First->Content()}

has been resolved. If you have any
further questions or concerns, please respond to this message.

Thanks,
The Support team.


this works as advertised.


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

Have you read the FAQ? The RT FAQ Manager lives at http://fsck.com/rtfm
Sean Lutner
Senior Systems & Network Administrator
TechTarget, Inc.
117 Kendrick St, Suite 800
Needham, MA 02494
P: 781-657-1337
F: 781-657-1100
E: sean@techtarget.com W: http://www.techtarget.com

“Imagination is more important than knowledge.” – Albert Einstein

Sorry to reply to my own post here. The -----'s were meant as a cut
line. My fault. My ticket resolved template is now exactly as follows…

According to our records your ticket has been resolved.
If you have any further questions or concerns, please reply to this
message.

Thank You

Yet when I resolve a ticket, no mail gets sent. I see no errors anywhere
to indicate what the problem is. Is there a way I can get soe more
verbose debugging from RT?On Fri, 2002-07-12 at 11:20, Sean Lutner wrote:

I tried putting your exact template in to test and now I get the
following error in my rt logs.

error: couldn’t parse head; error near:

Subject: Ticket Resolved

I’m not sure why. I have a leading blank line in the template. I’ve
tried it without a leading blank line.

This is the only template causing me issues. All the others, even ones
I’ve edited are performaing as expected. Now it seems that no matter
what I enter into the template when I edit it, mail stops being sent.

On Fri, 2002-07-12 at 10:39, Seth wrote:

On Fri, 12 Jul 2002 15:03:46 +0100 “Andy Coates” andy@bribed.net wrote:

{$Ticket->Transactions->First->Content()}

As soon as I changed the template to this, I stopped getting emails.

Odd, I just tried it too as it is a nice thing to have and it worked
perfectly, so the variable name is fine.

Andy.

I tried this also and it is working. Here is exactly what I have in my global->templates->7/Resolved:


Subject: Ticket Resolved

According to our records, your request,

{$Ticket->Transactions->First->Content()}

has been resolved. If you have any
further questions or concerns, please respond to this message.

Thanks,
The Support team.


this works as advertised.


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

Have you read the FAQ? The RT FAQ Manager lives at http://fsck.com/rtfm

Sean Lutner
Senior Systems & Network Administrator
TechTarget, Inc.
117 Kendrick St, Suite 800
Needham, MA 02494
P: 781-657-1337
F: 781-657-1100
E: sean@techtarget.com W: http://www.techtarget.com

“Imagination is more important than knowledge.” – Albert Einstein


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

Have you read the FAQ? The RT FAQ Manager lives at http://fsck.com/rtfm
Sean Lutner
Senior Systems & Network Administrator
TechTarget, Inc.
117 Kendrick St, Suite 800
Needham, MA 02494
P: 781-657-1337
F: 781-657-1100
E: sean@techtarget.com W: http://www.techtarget.com

“Imagination is more important than knowledge.” – Albert Einstein

Yet when I resolve a ticket, no mail gets sent. I see no errors anywhere
to indicate what the problem is. Is there a way I can get soe more
verbose debugging from RT?

in your config.pm under the logging section.
$LogToScreen = ‘debug’;
$LogToFile = ‘debug’;

also up by the top of the file set the line
$LogDir = “/var/log/rt”;
to where ever you want it to log to.

when these are set to debug you can see a log of what is going on. If you need to see more you can just add lines into the code such as the following (I used this line to debug my external user lookup)

$RT::Logger->debug(“LookupExternalUserInfo: Entered with:\n”,
“\tName = $params{‘Name’}\n”,
“\tEmailAddress = $params{‘EmailAddress’}\n”,
“\tRealName = $params{‘RealName’}\n”,
“\tFound = $FoundInExternalDatabase\n”)

but you can use the $RT::Logger->debug() anyware in RT and see what vars are set to etc.

-seth

After turning the log levels up to debug, I’ve got some more information
in my RT logs. Here’s what I’m seeing when I resolve a ticket.

RT::Transaction=HASH(0x10600f4): Checking condition OnResolve…
RT::Transaction=HASH(0x10600f4): Matches condition OnResolve…
now requiring RT::Action::Notify
RT::Action::Notify=HASH(0x109bf74): To is
sean@techtarget.comRT::Action::Notify=HASH(0x109bf74): Cc is
RT::Action::
Notify=HASH(0x109bf74): Bcc is
sean@techtarget.comRT::Transaction=HASH(0x10600f4): Prepared
NotifyAllWatchers
RT::Action::Notify=HASH(0x109bf74): No recipients found. Not sending.
RT::Transaction=HASH(0x10600f4): Committed NotifyAllWatchers

What I don’t get in that log is why it’s saying no recipients found. Not
sending, when it has both a To and a BCC. Now it looks to me like there
is not a problem with the template but somehere else.On Fri, 2002-07-12 at 11:47, Seth wrote:

On 12 Jul 2002 11:35:08 -0400 Sean Lutner sean@techtarget.com wrote:

Yet when I resolve a ticket, no mail gets sent. I see no errors anywhere
to indicate what the problem is. Is there a way I can get soe more
verbose debugging from RT?

in your config.pm under the logging section.
$LogToScreen = ‘debug’;
$LogToFile = ‘debug’;

also up by the top of the file set the line
$LogDir = “/var/log/rt”;
to where ever you want it to log to.

when these are set to debug you can see a log of what is going on. If you need to see more you can just add lines into the code such as the following (I used this line to debug my external user lookup)

$RT::Logger->debug(“LookupExternalUserInfo: Entered with:\n”,
“\tName = $params{‘Name’}\n”,
“\tEmailAddress = $params{‘EmailAddress’}\n”,
“\tRealName = $params{‘RealName’}\n”,
“\tFound = $FoundInExternalDatabase\n”)

but you can use the $RT::Logger->debug() anyware in RT and see what vars are set to etc.

-seth


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

Have you read the FAQ? The RT FAQ Manager lives at http://fsck.com/rtfm
Sean Lutner
Senior Systems & Network Administrator
TechTarget, Inc.
117 Kendrick St, Suite 800
Needham, MA 02494
P: 781-657-1337
F: 781-657-1100
E: sean@techtarget.com W: http://www.techtarget.com

“Imagination is more important than knowledge.” – Albert Einstein

Sorry for replying to myself again. It seems that the problem actually
lies in sending resolve emails to myself when I am the original
requestor of the ticket. I’ve just gone throw some tests with a
co-worker where he got several resovled ticket emails, and I also got
them when he was the resolver of the ticket. What’s weird is that if he
creates a ticket (assigning it to himself at creation), marks it to
open, then resolves he gets the resolved email. If I do the same, I get
no email. Just thought I’d share.

Thanks for all the help and tips with this.

SeanOn Fri, 2002-07-12 at 12:01, Sean Lutner wrote:

After turning the log levels up to debug, I’ve got some more information
in my RT logs. Here’s what I’m seeing when I resolve a ticket.

RT::Transaction=HASH(0x10600f4): Checking condition OnResolve…
RT::Transaction=HASH(0x10600f4): Matches condition OnResolve…
now requiring RT::Action::Notify
RT::Action::Notify=HASH(0x109bf74): To is
sean@techtarget.comRT::Action::Notify=HASH(0x109bf74): Cc is
RT::Action::
Notify=HASH(0x109bf74): Bcc is
sean@techtarget.comRT::Transaction=HASH(0x10600f4): Prepared
NotifyAllWatchers
RT::Action::Notify=HASH(0x109bf74): No recipients found. Not sending.
RT::Transaction=HASH(0x10600f4): Committed NotifyAllWatchers

What I don’t get in that log is why it’s saying no recipients found. Not
sending, when it has both a To and a BCC. Now it looks to me like there
is not a problem with the template but somehere else.

On Fri, 2002-07-12 at 11:47, Seth wrote:

On 12 Jul 2002 11:35:08 -0400 Sean Lutner sean@techtarget.com wrote:

Yet when I resolve a ticket, no mail gets sent. I see no errors anywhere
to indicate what the problem is. Is there a way I can get soe more
verbose debugging from RT?

in your config.pm under the logging section.
$LogToScreen = ‘debug’;
$LogToFile = ‘debug’;

also up by the top of the file set the line
$LogDir = “/var/log/rt”;
to where ever you want it to log to.

when these are set to debug you can see a log of what is going on. If you need to see more you can just add lines into the code such as the following (I used this line to debug my external user lookup)

$RT::Logger->debug(“LookupExternalUserInfo: Entered with:\n”,
“\tName = $params{‘Name’}\n”,
“\tEmailAddress = $params{‘EmailAddress’}\n”,
“\tRealName = $params{‘RealName’}\n”,
“\tFound = $FoundInExternalDatabase\n”)

but you can use the $RT::Logger->debug() anyware in RT and see what vars are set to etc.

-seth


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

Have you read the FAQ? The RT FAQ Manager lives at http://fsck.com/rtfm

Sean Lutner
Senior Systems & Network Administrator
TechTarget, Inc.
117 Kendrick St, Suite 800
Needham, MA 02494
P: 781-657-1337
F: 781-657-1100
E: sean@techtarget.com W: http://www.techtarget.com

“Imagination is more important than knowledge.” – Albert Einstein


rt-users mailing list
rt-users@lists.fsck.com
http://lists.fsck.com/mailman/listinfo/rt-users

Have you read the FAQ? The RT FAQ Manager lives at http://fsck.com/rtfm
Sean Lutner
Senior Systems & Network Administrator
TechTarget, Inc.
117 Kendrick St, Suite 800
Needham, MA 02494
P: 781-657-1337
F: 781-657-1100
E: sean@techtarget.com W: http://www.techtarget.com

“Imagination is more important than knowledge.” – Albert Einstein

Phil Homewood pdh@snapgear.com (2002-Jul-12 09:26) wrote:

Sean Lutner wrote:

I’ve posted about this before, and I’ve been scouring the list archives
to no avail. What I would like to do is edit and/or replace the Ticket
Resolved template to include the original request. […]

{$Ticket->Transactions->First->Content()}

I’ve been working on a related problem, and this solved the first part
of it. Thanks!

Now the second part:

I like to also include the final comment made by the person resolving
the ticket.

Here’s the Template:

Ticket No.: [{$rtname} #{$Ticket->id}]

According to our records, your request has been resolved. If you have any
further questions or concerns, please respond to this message.

Thanks,
The HLRN Support Team

Your request and the final remarks are noted below.
— Your request was -------------------------------------------

{$Ticket->Transactions->First->Content()}

---- Final remarks are ------------------------------------------

{$Ticket->Transactions->Last->Content()}

This works as intended, but not in all cases.

Resolving a ticket logs both the status change and the correspondence.

Sometimes the correspondence is the last item and is written in the mail, as we expect.

When the status change ist the last transaction nothing gets written in the
mail (which is correct from a logical point of view).

How do I get the correspondence?

Or, how do I enforce the sequence of transactions recorded (first the
status change then the correspondence)?

Have A Nice Day,
Wolfgang
Wolfgang W. Baumann baumann@zib.de CFD Consultant @ ZIB & HLRN

I like to also include the final comment made by the person resolving
the ticket.

This may or may not work for you (as one line):

{ my $have_last=0; my $retval = undef; my $newtrans=$Ticket->Transactions;
$newtrans->OrderBy( FIELD => ‘id’, ORDER => ‘DESC’ ); while( my
$thistrans = $newtrans->Next && $have_last == 0 ){ next unless(
$thistrans->Type eq ‘Correspond’ ); $have_last++;
$retval=$thistrans->Content unless( defined( $retval ) ); } $retval; }

( Grab the transactions, reverse the ordering, step through until we find
an instance of correspondence, return the first (really the last) one
found. Never ever return Comments to the punters. )

Or, how do I enforce the sequence of transactions recorded (first the
status change then the correspondence)?

I think the WebUI is committing the correspondence before the status
change, but the default ordering in Transactions.pm is by ‘Created’. This
may mean that MySQL is not giving the rows in a known order if two rows
have the same ‘created’ value.

Hence, adding an additional OrderBy clause in _Init() of Transactions.pm
to sort on id, ascending may fix your problem.

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