[rt-users] Scrip Help?

Aaron Guise aaron at guise.net.nz
Sun Jan 17 19:30:22 EST 2010


Hi All,

I have a scrip setup as below;

Condition:  OnComment
Action:      User Defined
Template:  Global Blank
Stage:       Transaction Create

Custom Condition:
Custom Action Preparation Code:     return 1;
Custom Action Cleanup Code:
my $string = $self->TransactionObj->Content;
$string =~ m/Status changed from ([A-Za-z]{3}) to ([A-Za-z]{3})/;

my $old = $1;
my $new = $2;
my $ticket = $self->TicketObj;
my $cf_obj = RT::CustomField->new($RT::SystemUser);
my $cf_name = "CustomStatus";
my $cf_value;
$cf_value = $new;
$cf_obj->LoadByName(Name=>$cf_name);
$RT::Logger->debug("Loaded\$cf_obj->Name = ". $cf_obj->Name() ."\n");
$ticket->AddCustomFieldValue(Field=>$cf_obj, Value=>$cf_value,
RecordTransaction=>1);
return 1;

However the damn thing never seems to fire off,  I have tested the regexp
directly in perl and it works.  I am pretty sure also that it used to work
but for some reason no longer does.

Essentially we have rules on our mail clients which forward mail back to RT
from our outsourced Service provider,  the content looks like this when they
change a status.

Subject: SR129018, CustRef: 54795, QUE

 atus.

This is an automatically generated email from Aaron Guise using Gentrack SR
System.



SR129018, CustRef: 54795

<https://www.gentrack.com/srweb/srdetails.asp?SRNo=129018>

Status changed from WAI to QUE



Think before you Print - By making good use of resources at work we can
encourage sustainability and manage our impact. Change Tomorrow by Changing
Thinking Today





Disclaimer:

The information contained in this email may be confidential. If you are not
the intended recipient, you must not disclose or use the information in this
email or any attachment in any way.

If you received it in error, please tell us immediately by return email, and
delete the document. Genesis Power Limited, trading as Genesis Energy, does
not accept any responsibility for viruses or anything similar in this email
or any attachments. We also do not guarantee the integrity of any emails or
attached files or accept any responsibility for any changes made to them by
any other person.


Does anyone have any ideas why this may not be triggering.  I may be just
losing sight of a simple thing I feel, but it is now driving me a little
nuts.
*
Regards,*

*Aaron Guise

  07 838 7793
027 212 6638
aaron at guise.net.nz
 *


MSN: guisea at hotmail.com
 [image: Facebook] <http://www.facebook.com/shadysandman>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20100118/a4a668ff/attachment.htm>


More information about the rt-users mailing list