<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello,<br>
<br>
I am running into an issue with a simple scrip that I want to use to
generate a reminder for the owner of a ticket when its status
changes to stalled. I have the conditions working but the action
script returns some errors. Here is the action script that I wrote
according to the RT::Date and RT::Reminders perldocs.<br>
<br>
<b>my $tix = $self->TicketObj;<br>
my $duedate = RT::Date->new($RT::SystemUser);<br>
my $subject = "Test Subject";<br>
my $owner = $tix->Owner;<br>
my $reminder = RT::Reminders->new($RT::SystemUser);<br>
<br>
$duedate->SetToNow();<br>
$duedate->AddDays( 3 );<br>
<br>
$reminder->Add( Subject => $subject, Owner => $owner, Due
=> $duedate->ISO ); <br>
return 1;</b><br>
<br>
The error messages in the debug log are:<b><br>
<br>
[Wed Aug 31 16:21:27 2011] [debug]: Tried to load a bogus ticket
id: '' (/opt/rt4/sbin/../lib/RT/Ticket.pm:158)<br>
[Wed Aug 31 16:21:27 2011] [debug]: '' not a recognised queue
object. (/opt/rt4/sbin/../lib/RT/Ticket.pm:273)<br>
[Wed Aug 31 16:21:27 2011] [debug]:
RT::Ticket=HASH(0x2b986db2a320) No queue given for ticket
creation. (/opt/rt4/sbin/../lib/RT/Ticket.pm:278)</b><br>
<br>
In the Reminders.pm file, these errors are generated from this
ticket creation object within RT::Reminders->Add:<br>
<br>
<b>my ( $status, $msg ) = $reminder->Create(<br>
Subject => $args{'Subject'},<br>
Owner => $args{'Owner'},<br>
Due => $args{'Due'},<br>
RefersTo => $self->Ticket,<br>
Type => 'reminder',<br>
Queue => $self->TicketObj->Queue,<br>
);</b><br>
<br>
Any ideas why this might be throwing null results for
$self->Ticket and $self->TicketObj? Do I need to call the
RT::Reminders->Ticket and RT::Reminders->TicketObj methods
earlier in the script? Should I not be creating the RT::Reminders
object as system user?<br>
<br>
I'd appreciate any feedback!<br>
<pre class="moz-signature" cols="72">--
Andrew Wagner
Assistant Network Administrator
<a class="moz-txt-link-abbreviated" href="mailto:aawagner@wisc.edu">aawagner@wisc.edu</a>
265-5710
Room 370B
Wisconsin Center for Education Research (WCER)
<a class="moz-txt-link-abbreviated" href="http://www.wcer.wisc.edu">www.wcer.wisc.edu</a>
</pre>
</body>
</html>