[rt-users] User Created Scrip Won't Run On Create

Ethan Hohensee ethan.hohensee at live.com
Wed Feb 12 10:46:17 EST 2014


I'm having some issues getting a scrip I wrote to run in RT 4.2.2. I am
attempting to populate some custom fields from XML in an email submitted
ticket but in the process of troubleshooting, I noticed that the scrip
itself was not being traversed when email tickets are being submitted. The
tickets are created and the autoreply goes out just fine, but my scrip with
the same On Create condition does not execute. These are the debug logs
showing the scrips that run On Create and the code for my custom Scrip,
which is number 16. 
*
Debug Logs:*
/Feb 11 16:16:30 vector RT: [22799]
<rt-4.2.2-22799-1392153390-1915.105-7-0 at example.com> #105/703 - Scrip 7 On
Create Autoreply To Requestors
Feb 11 16:16:30 vector RT: [22799]
<rt-4.2.2-22799-1392153390-1915.105-7-0 at example.com> sent  To:
*****************
Feb 11 16:16:30 vector RT: [22799]
<rt-4.2.2-22799-1392153390-491.105-8-0 at example.com> #105/703 - Scrip 8 On
Create Notify Owner and AdminCcs
Feb 11 16:16:30 vector RT: [22799]
<rt-4.2.2-22799-1392153390-491.105-8-0 at example.com> No recipients found. Not
sending.
Feb 11 16:16:30 vector RT: [22799]
<rt-4.2.2-22799-1392153390-683.105-9-0 at example.com> #105/703 - Scrip 9 On
Create Notify Ccs
Feb 11 16:16:30 vector RT: [22799]
<rt-4.2.2-22799-1392153390-683.105-9-0 at example.com> No recipients found. Not
sending.
Feb 11 16:16:30 vector RT: [22799]
<rt-4.2.2-22799-1392153390-172.105-10-0 at example.com> #105/703 - Scrip 10 On
Create Notify Other Recipients
Feb 11 16:16:30 vector RT: [22799]
<rt-4.2.2-22799-1392153390-172.105-10-0 at example.com> No recipients found.
Not sending.
Feb 11 16:16:30 vector RT: [22799] Ticket 105 created in queue 'DMCA' by
**************/

*Scrip:*
Conditon: On Create
Action: User Defined
Template: Blank

User Defined Conditions and Results:
  Custom Conditon: <empty>
  Custom Action Preperation Code: /return 1;/
  Custom Action Commit Code:

/# Get the current transaction and ticket objects
my $transaction = $self->TransactionObj;
my $ticket = $self->TicketObj;

# Create the Custom Field and specify the name
my $cf_obj = RT::CustomField->new($RT::SystemUser);
my $cf_name = "Case ID";

my $content = $transaction->Content;
my $cf_value = $content =~ /<ID>(.*)<\/ID>/;
RT::Logger->debug($cf_value);

#RT::Logger->debug($cf_obj->Name); 

$cf_obj->LoadByName(Name=>$cf_name);
$ticket->AddCustomFieldValue(Field=>$cf_obj, Value=>$cf_value);
return 1;
/
 
I have tried to simply put "return 1;" in both the prep and commit code and
still haven't had any luck getting this scrip to run. I am not really
concerned with the parsing logic at this point, I would just like to get it
to trigger On Create. Here is the alias I am using to submit my tickets via
the local PostFix install:

/dmcanotices:    "|/opt/rt4/bin/rt-mailgate --queue DMCA --action correspond
--url https://192.168.160.xxx"/

Any help anyone can provide would be greatly appreciated. I am entering day
3 of this issue, and I'm out of ideas.




--
View this message in context: http://requesttracker.8502.n7.nabble.com/User-Created-Scrip-Won-t-Run-On-Create-tp56616.html
Sent from the Request Tracker - User mailing list archive at Nabble.com.



More information about the rt-users mailing list