[rt-users] Problems with status changing scrip

Zoey Schutt zoey at braincoral.io
Mon May 16 08:36:07 EDT 2016


Hello,


I am working on a scrip to auto-change the status of a ticket if it is set to "customer" status. However, I do not want the ticket to change status if the user who is replying to the ticket is the owner. I managed to get the status changing properly, but as soon as I try to setup the condition it no longer works. Could someone look this over for me and tell me where I'm messing up?


Condition: On Correspond

Action: User Defined

Template: Blank


Custom action preparation code:

return 1;

Custom action commit code:

# Abort if actor is owner of ticket
return 1 unless $self->TicketObj->Owner != $actor->id;

# Change status to "open" if status is "customer"
if ($self->TicketObj->Status() eq 'customer' ) {
$self->TicketObj->SetStatus('open');
$RT::Logger->info("Customer replied to ticket awaiting reply. Status set to open.");
return 1;
}
return undef;


RT Information:


RT 4.2.12

Perl v5.14.2 built for x86_64-linux-gnu-thread-multi

Apache 2.2.22

PHP 5.5.33-1~dotdeb+7.1

MySQL Ver 14.14 Distrib 5.5.49


Thanks,


Zoey Schutt

Braincoral Technology, LLC
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20160516/dda57d2f/attachment.htm>


More information about the rt-users mailing list