[rt-users] Add incremental time worked in a scrip

Kevin Falcone falcone at bestpractical.com
Fri Sep 14 15:28:17 EDT 2012


On Thu, Sep 13, 2012 at 07:24:38AM +0200, Robert Wysocki wrote:
> Dnia 2012-09-11, wto o godzinie 17:51 +0200, Maciej Dobrzanski pisze:
> > Gary,
> > 
> > ➢ I bet this is really easy, but I'm stumped. The wiki didn't help me either.
> > 
> > If you want to associate times with comments, you need to make sure
> > they are stored inside the corresponding transactions. However
> > transaction objects are immutable, so you probably can't modify them
> > from Scrips. I think you will need to intercept a callback in ticket
> > update and update ticket parameters (UpdateTimeWorked) before they
> > enter the RT core.
> 
> I think TransactionBatch scrips are meant to do that.

TransactionBatch scrips just run after all the transactions in an
update are done, they don't have to do with changing transactions.
Also, the TransactionBatch scrip would require you to iterate through
all the related transactions to find the right one to update, while
the On Correspond scrip living in TransactionCreate would get the
right transaction automatically.

As noted by Maciej - far and away the easiest thing is to use a
callback or some JS to insert a default into the UpdateTimeWorked on
Update.html.  You can do it from a Scrip, but you have to use a hammer
to update the Transactions.

-kevin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20120914/2bb5de71/attachment.sig>


More information about the rt-users mailing list