Re: [rt-users] Scrips being executed twice for a simple CF update
On 9/14/2012 1:40 PM, Kevin Falcone wrote: On Mon, Sep 10, 2012 at 04:57:33PM -0400, Jeff Blaine wrote: Upon modification of one of our custom fields (text area), we want to parse the data, perform a translation on the original data, and store the results in the custom field. With loads of RT::Logger debugging in place, everything appears to be working fine except for the for the fact that the Scrip is being called twice, and it's performing the change ... then UNDOING IT: I suspect you're running into the processing order of updates on the Basics page. You can try making the Scrip TransactionBatch and see if that resolves it. For the record, that seems to have worked. Thanks Kevin Jeff Keep in mind that TransactionCreate scrips don't see all the updates done on that page at once, it sees them piecemeal. -kevin Final RT training for 2012 in Atlanta, GA - October 23 & 24 http://bestpractical.com/training We're hiring! http://bestpractical.com/jobs
Re: [rt-users] Scrips being executed twice for a simple CF update
On Mon, Sep 10, 2012 at 04:57:33PM -0400, Jeff Blaine wrote: > Upon modification of one of our custom fields (text area), > we want to parse the data, perform a translation on the > original data, and store the results in the custom field. > With loads of RT::Logger debugging in place, everything appears > to be working fine except for the for the fact that the Scrip > is being called twice, and it's performing the change ... then > UNDOING IT: I suspect you're running into the processing order of updates on the Basics page. You can try making the Scrip TransactionBatch and see if that resolves it. Keep in mind that TransactionCreate scrips don't see all the updates done on that page at once, it sees them piecemeal. -kevin > Sep 10 16:24:39 rtdev2 RT: START SCRIP processing OurField > Sep 10 16:24:39 rtdev2 RT: OurField changed: OLD '' NEW '26 34' > Sep 10 16:24:39 rtdev2 RT: OurField: In main chunk > Sep 10 16:24:39 rtdev2 RT: OurField: 2 values found > Sep 10 16:24:39 rtdev2 RT: OurField: Processing: '26' > Sep 10 16:24:39 rtdev2 RT: OurField: Processing: '34' > Sep 10 16:24:39 rtdev2 RT: OurField: Final string: 'X Y' > Sep 10 16:24:39 rtdev2 RT: OurField reached final return 1 > Sep 10 16:24:39 rtdev2 RT: START SCRIP processing OurField > Sep 10 16:24:39 rtdev2 RT: OurField changed: OLD 'X Y' NEW '' > Sep 10 16:24:39 rtdev2 RT: OurField: In main chunk > Sep 10 16:24:39 rtdev2 RT: OurField: 0 values found > Sep 10 16:24:39 rtdev2 RT: OurField: Final string empty, so clearing > out OurField entirely > Sep 10 16:24:39 rtdev2 RT: OurField reached final return 1 pgp3tUbSPSP9V.pgp Description: PGP signature Final RT training for 2012 in Atlanta, GA - October 23 & 24 http://bestpractical.com/training We're hiring! http://bestpractical.com/jobs
[rt-users] Scrips being executed twice for a simple CF update
Upon modification of one of our custom fields (text area), we want to parse the data, perform a translation on the original data, and store the results in the custom field. Simplified/contrived example: INPUT: Basics: OurField: 4 5 8 9 32 90 [SAVE]*click* RESULT: Basics: OurField: X Y A B Z O We're obviously using a Scrip to do this field processing. It's not working out too hot, so I *must* be doing something wrong. === # Name: ParseAndWrite_Ourfield # # User Defined # User Defined # Blank template # TransactionCreate Custom condition: if field changed return 1 Preparation: return 1 Clean-up: parse ourfield initialize final_string to "" for each item found: perform lookup append lookup result to final_string set OurField value to final_string return 1 === With loads of RT::Logger debugging in place, everything appears to be working fine except for the for the fact that the Scrip is being called twice, and it's performing the change ... then UNDOING IT: Sep 10 16:24:39 rtdev2 RT: START SCRIP processing OurField Sep 10 16:24:39 rtdev2 RT: OurField changed: OLD '' NEW '26 34' Sep 10 16:24:39 rtdev2 RT: OurField: In main chunk Sep 10 16:24:39 rtdev2 RT: OurField: 2 values found Sep 10 16:24:39 rtdev2 RT: OurField: Processing: '26' Sep 10 16:24:39 rtdev2 RT: OurField: Processing: '34' Sep 10 16:24:39 rtdev2 RT: OurField: Final string: 'X Y' Sep 10 16:24:39 rtdev2 RT: OurField reached final return 1 Sep 10 16:24:39 rtdev2 RT: START SCRIP processing OurField Sep 10 16:24:39 rtdev2 RT: OurField changed: OLD 'X Y' NEW '' Sep 10 16:24:39 rtdev2 RT: OurField: In main chunk Sep 10 16:24:39 rtdev2 RT: OurField: 0 values found Sep 10 16:24:39 rtdev2 RT: OurField: Final string empty, so clearing out OurField entirely Sep 10 16:24:39 rtdev2 RT: OurField reached final return 1