Scrip modifies ticket, but downstream scrips don't see the updates

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:

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't-see-the-updates-tp30599938p30599938.html

Sue,

Try changing the stage to “TransactionBatch”. Make sure your configuration
is set to use same. Then, you need to be sure the names of the scrips a such
that an alphabetical execution of them will execute the scrip that assigns
the owners first.

Kenn
LBNLOn Wed, Jan 5, 2011 at 12:46 PM, Sue D. Nymme sdn.oldnab@mailnull.comwrote:

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.

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: Scrip modifies ticket, but downstream scrips
don’t see the updateshttp://old.nabble.com/Scrip-modifies-ticket%2C-but-downstream-scrips-don’t-see-the-updates-tp30599938p30599938.html
Sent from the Request Tracker - User mailing list archivehttp://old.nabble.com/Request-Tracker---User-f572.htmlat Nabble.com.

Hot dig! Changing the second scrip to “TransactionBatch” did indeed work.
Thank you!

Now I just have to translate the new owner’s id into their user name, and
I’ll be set.

– Sue

Kenneth Crocker wrote:

Sue,

Try changing the stage to “TransactionBatch”. Make sure your configuration
is set to use same. Then, you need to be sure the names of the scrips a
such
that an alphabetical execution of them will execute the scrip that assigns
the owners first.

Kenn
LBNL

View this message in context: http://old.nabble.com/Scrip-modifies-ticket%2C-but-downstream-scrips-don't-see-the-updates-tp30599938p30605822.html

There’s also some actions, like Notify, that read their data in prepare, so
any changes done in commit won’t be seen. Been bitten.

Mathieu Longtin
1-514-803-8977On Thu, Jan 6, 2011 at 11:39 AM, Sue D. Nymme sdn.oldnab@mailnull.comwrote:

Hot dig! Changing the second scrip to “TransactionBatch” did indeed work.
Thank you!

Now I just have to translate the new owner’s id into their user name, and
I’ll be set.

– Sue

Kenneth Crocker wrote:

Sue,

Try changing the stage to “TransactionBatch”. Make sure your
configuration
is set to use same. Then, you need to be sure the names of the scrips a
such
that an alphabetical execution of them will execute the scrip that
assigns
the owners first.

Kenn
LBNL

On Wed, Jan 5, 2011 at 12:46 PM, Sue D. Nymme sdn.oldnab@mailnull.comwrote:


View this message in context:
http://old.nabble.com/Scrip-modifies-ticket%2C-but-downstream-scrips-don't-see-the-updates-tp30599938p30605822.html
Sent from the Request Tracker - User mailing list archive at Nabble.com.