[rt-users] Scrip modifies ticket, but downstream scrips don't see the updates

Sue D. Nymme sdn.oldnab at mailnull.com
Wed Jan 5 15:46:01 EST 2011


One of our queues receives job requests via e-mail.  I have a scrip in place
that automatically assigns the newly-created ticket to any of several users,
if the subject is in a certain, easily-parsed format.  This works fine.


For this scrip, the condition is "On Create", the action is "User Defined",
the template is "Blank", and the stage is "TransactionCreate".  You can view
it at  http://www.nopaste.nl/?paste=2004 http://www.nopaste.nl/?paste=2004 .


Like I said, it works fine, but downstream scrips do NOT seem to see the
update.  I modified the WatchCreate template to include a line that says
"This ticket has been assigned to [so-and-so]".  This does not work.  It
sees the original owner, not the owner that was set by the earlier scrip. 
Yet, after the ticket is created, I can go into the RT web interface and see
that the owner was set properly.  My WatchCreate template is as follows:

Subject: New ticket {$Ticket->id}: {$Ticket->Subject}


Greetings,
{my ($id, $subj, $own) = ($Ticket->id, $Ticket->Subject,
$Ticket->Owner);
$RT::Logger->debug(qq#EJR-WatchCreate (queue): ID=$id, owner=$own,
subj=$subj#);
"$id -- $own";}
This message has been automatically generated in response to the
creation of support ticket number {$Ticket->id}, regarding:
	"{$Ticket->Subject()}", 
a summary of which appears below.
{my $owner = $Ticket->Owner;
($owner && $owner ne 'Nobody' && $owner !=
$RT::Nobody->Id)?
    "\nThis ticket has been assigned to $owner."
  : "\nThis ticket has not been assigned to anyone."
}

Please don't reply to this message.  This ticket has been
assigned an ID of [{$Ticket->QueueObj->SubjectTag || $rtname}
#{$Ticket->id()}].

-------------------------------------------------------------------------
{$Transaction->Content()}


When I look in the RT debug log, I can see that the assign-owner scrip runs
first, and is successful, and the notify-watchers scrip runs later—but
the log-debug in the notify-watchers scrip does not write anything to the
log.  However, the "$id -- $own" line does get inserted into the
e-mail, so I know my code is being executed.  Anyhow, the user id that this
code block inserts into the watcher e-mail is the original owner (id 6,
Nobody), not the owner that was set by the earlier scrip.


What step am I missing here?

-- 
View this message in context: http://old.nabble.com/Scrip-modifies-ticket%2C-but-downstream-scrips-don%27t-see-the-updates-tp30599938p30599938.html
Sent from the Request Tracker - User mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20110105/d01c299b/attachment.htm>


More information about the rt-users mailing list