Automatic resolve on e-mail reply

Hi,
I’m currently setting up RT and wondered if the following was possible…
somebody sends an e-mail to a support queue, this is passed on to
AdminCC’s,
when an AdminCC replies I want the ticket to be automatically resolved and
removed from the queue.
The queue then only shows unresolved tickets and no manual queue
management is involved.

If a scrip is needed to implement this, does anybody have this done
already?

Thanks for your time,
Max
University of Bath Computer Services, UK

M B Norton wrote:

I’m currently setting up RT and wondered if the following was possible…
when an AdminCC replies I want the ticket to be automatically resolved and
removed from the queue.

If a scrip is needed to implement this, does anybody have this done
already?

This should be fairly trivial… off the top of my head
(and all untested, take note!)

OnCorrespOut ResolveTicket with template Blank

package RT::Condition::OnCorrespOut;
require RT::Condition::Generic;
@ISA = qw(RT::Condition::Generic);

sub IsApplicable {
my $self = shift;
return($self->TransactionObj->Type eq ‘Correspond’ && !$self->IsInbound);
}
1;
package RT::Action::ResolveTicket;
require RT::Action::Generic;
@ISA = qw(RT::Action::Generic);

sub Commit {
my $self = shift;
return ($self->TicketObj->Resolve());
}
1;

Phil Homewood, Systems Janitor, www.SnapGear.com
pdh@snapgear.com Ph: +61 7 3435 2810 Fx: +61 7 3891 3630
SnapGear - Custom Embedded Solutions and Security Appliances

M B Norton wrote:

I’m currently setting up RT and wondered if the following was possible…
when an AdminCC replies I want the ticket to be automatically resolved and
removed from the queue.

If a scrip is needed to implement this, does anybody have this done
already?

This should be fairly trivial… off the top of my head
(and all untested, take note!)

OnCorrespOut ResolveTicket with template Blank

Result is still indeterminate if used from the WebUI, as the WebUI also
sets several status variables.

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

Bruce Campbell wrote:

OnCorrespOut ResolveTicket with template Blank

Result is still indeterminate if used from the WebUI, as the WebUI also
sets several status variables.

Indeed. While I’m not interested enough to come up with a patch
to fix this, I did post one to rt-users to work around a similar
problem with AutoTake on June 1 2002; that would probably make a
pretty good basis for a new patch to address this issue. Search
The Friendly Archives. :slight_smile:
Phil Homewood, Systems Janitor, www.SnapGear.com
pdh@snapgear.com Ph: +61 7 3435 2810 Fx: +61 7 3891 3630
SnapGear - Custom Embedded Solutions and Security Appliances

Thanks for the help,
I’ve been slowly working on this and sure enough the WebUI does something
beyond simply calling TicketObj->Resolve. The scrip action succeeds in
marking the ticket as resolved but it’s then opened again immediately.
Looking at the the ticket history I see:

RT_System - Status changed from open to resolved
RT_System - Status changed from resolved to open

Actually setting the “status” field in the relevant mysql entry to
“resolved” is enough to resolve the ticket and stop it from showing in
the queue.
I’m assuming there’s something else within RT that needs to be done during
that transaction in order to complete it successfully.
Does anybody have any idea what that is?
I’ve been trying to work through the perl but it’s currently got me
beaten.

Thanks in advance for any help,
MaxOn Fri, 23 Aug 2002, Bruce Campbell wrote:

On Fri, 23 Aug 2002, Phil Homewood wrote:

M B Norton wrote:

I’m currently setting up RT and wondered if the following was possible…
when an AdminCC replies I want the ticket to be automatically resolved and
removed from the queue.

If a scrip is needed to implement this, does anybody have this done
already?

This should be fairly trivial… off the top of my head
(and all untested, take note!)

OnCorrespOut ResolveTicket with template Blank

Result is still indeterminate if used from the WebUI, as the WebUI also
sets several status variables.


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

M B Norton wrote:

I’ve been slowly working on this and sure enough the WebUI does something
beyond simply calling TicketObj->Resolve. The scrip action succeeds in
marking the ticket as resolved but it’s then opened again immediately.
Looking at the the ticket history I see:

RT_System - Status changed from open to resolved
RT_System - Status changed from resolved to open

Replace this line in webrt/Ticket/Update.html

DefaultStatus = $Ticket->Status() unless ($DefaultStatus);

with something like

unless ($DefaultStatus) {
$DefaultStatus = $Ticket->Status();
if ($DefaultStatus eq “open” && $Action eq “Respond”) {
$DefaultStatus= “resolved”;
}
}

which will make the “Status” dropdown on the correspondence page
default to “resolved” if the ticket is open.

Hack, hack, hack…
Phil Homewood, Systems Janitor, www.SnapGear.com
pdh@snapgear.com Ph: +61 7 3435 2810 Fx: +61 7 3891 3630
SnapGear - Custom Embedded Solutions and Security Appliances