TransactionBatch Notifications

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

We would like to move all of our notifications (via Scrips) into the
TransactionBatch stage so that we can ensure some pre-processing before
an email is sent out, but when using the Ticket/Update.html page a
couple bugs with the display of Scrip recipients pop up:

  1. The TransactionBatch Scrips do not show up in the list of scrips that
    will send to recipients.

  2. The DryRun done by the page to determine the Scrips and possible
    recipients invokes the TransactionBatch Scrips NOT as DryRun and thus
    sends and email with no content to the recipients.

Anyone else come across this and have an easy resolution?


Joby Walker
ITI SSG, University of Washington


PGP key: https://staff.washington.edu/joby/joby-u-pub.asc
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDPZtYgA0gpghkf88RApivAKDU1DPoVi+WZ5mhd4KeAVNYPsQmxACcCTCb
mUEk6brWtHiSfW1ATxeR5EU=
=/Tuw
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hmm… with the current structure of the TransactionBatch #1 just isn’t
possible. TransactionBatch is run by the Destructor of the TicketObj,
which should only be done as the page view is over. Not how I’d have
done it.

#2 is easy to prevent. In RT::Record->_NewTransaction:


if ( defined $args{'TimeTaken'} ) {
    $self->_UpdateTimeTaken( $args{'TimeTaken'} );
}
    • if ( $RT::UseTransactionBatch and $transaction ) {
  • if ( $RT::UseTransactionBatch and $transaction and
    $args{‘CommitScripts’}) {
    push @{$self->{_TransactionBatch}}, $trans;
    }
    return ( $transaction, $msg, $trans );

All this does is prevent DryRun transactions from being added to the
array of transactions that TransactionBatch Scrips should be run from.

Joby Walker
ITI SSG, University of Washington


PGP key: https://staff.washington.edu/joby/joby-u-pub.asc

Joby Walker wrote:

We would like to move all of our notifications (via Scrips) into the
TransactionBatch stage so that we can ensure some pre-processing before
an email is sent out, but when using the Ticket/Update.html page a
couple bugs with the display of Scrip recipients pop up:

  1. The TransactionBatch Scrips do not show up in the list of scrips that
    will send to recipients.

  2. The DryRun done by the page to determine the Scrips and possible
    recipients invokes the TransactionBatch Scrips NOT as DryRun and thus
    sends and email with no content to the recipients.

Anyone else come across this and have an easy resolution?
The rt-users Archives

Be sure to check out the RT Wiki at http://wiki.bestpractical.com

Buy your copy of our new book, RT Essentials, today!

Download a free sample chapter from http://rtbook.bestpractical.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFDPa1PgA0gpghkf88RAjqbAKDVUJb1LydeNeehZAe/42X7rGAU+wCgrP3I
uoT3qmVsVrhHTkPZ3QrJA0E=
=hR6O
-----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

We would like to move all of our notifications (via Scrips) into the
TransactionBatch stage so that we can ensure some pre-processing before
an email is sent out, but when using the Ticket/Update.html page a
couple bugs with the display of Scrip recipients pop up:

  1. The TransactionBatch Scrips do not show up in the list of scrips that
    will send to recipients.

  2. The DryRun done by the page to determine the Scrips and possible
    recipients invokes the TransactionBatch Scrips NOT as DryRun and thus
    sends and email with no content to the recipients.

Anyone else come across this and have an easy resolution?

Both of those do sound like bugs to me. I think the answer to 2) is to
make the “CommitScrips” argument to Transaction->Create accessible
after record creation and making RT::Scrips->Apply take note of that.

The answer to 1) is likely forcing the batch to run earlier in the page
flow. I’d be thrilled to see a patch. (And if not a patch, please bounce
this to rt-bugs so it doesn’t get lost)

Jesse