Scrip using TransactionBatch is run twice

I just discovered on RT 4.0.13 and 4.2.4 (not tested on latest one) that
creating a scrip with:

condition: “AnyTransaction”
custom prepare code: “return 1;”
custom commit code : RT->Logger->debug(“test scrip”); return 1;
stage: Batch

then doing an update on the ticket using /Ticket/Update.html with a
corespondence and a cf change, the scrip action commit code is run twice!

do I misunderstand something or is this really a bug?

Easter-eggs Spécialiste GNU/Linux
44-46 rue de l’Ouest - 75014 Paris - France - Métro Gaité
Phone: +33 (0) 1 43 35 00 37 - Fax: +33 (0) 1 43 35 00 76
mailto:elacour@easter-eggs.com - http://www.easter-eggs.com

Check the ticket history: that update is two transactions: Adding a
comment and changing a CF.
Transaction is from the back end’s point of view, not the users.

that’s why I’m using TransactionBatch …

Easter-eggs Spécialiste GNU/Linux
44-46 rue de l’Ouest - 75014 Paris - France - Métro Gaité
Phone: +33 (0) 1 43 35 00 37 - Fax: +33 (0) 1 43 35 00 76
mailto:elacour@easter-eggs.com - http://www.easter-eggs.com

I just discovered on RT 4.0.13 and 4.2.4 (not tested on latest one) that
creating a scrip with:

condition: “AnyTransaction”
custom prepare code: “return 1;”
custom commit code : RT->Logger->debug(“test scrip”); return 1;
stage: Batch

then doing an update on the ticket using /Ticket/Update.html with a
corespondence and a cf change, the scrip action commit code is run twice!

do I misunderstand something or is this really a bug?

Check the ticket history: that update is two transactions: Adding a
comment and changing a CF.
Transaction is from the back end’s point of view, not the users.

Jeff

Check the ticket history: that update is two transactions: Adding a
comment and changing a CF.
Transaction is from the back end’s point of view, not the users.

that’s why I’m using TransactionBatch …

got it and here is the fix :slight_smile:

https://issues.bestpractical.com/Ticket/Display.html?id=31269

Easter-eggs Spécialiste GNU/Linux
44-46 rue de l’Ouest - 75014 Paris - France - Métro Gaité
Phone: +33 (0) 1 43 35 00 37 - Fax: +33 (0) 1 43 35 00 76
mailto:elacour@easter-eggs.com - http://www.easter-eggs.com