[rt-users] TransactionBatch and TransactionCreate [mx]]
Michael Bochynski
mbochynski at audiumcorp.com
Thu Aug 5 13:21:46 EDT 2004
> Your question should be something like this:
> I have scrip that notify peoples(including ticket's AdminCcs) on create.
> And also on create I have scrip that adds AdminCC to ticket. RT doesn't
> notify AdminCcs. Why? :)
>
> 1) You didn't read well
> http://wiki.bestpractical.com/index.cgi?ScripExecOrder.
>
I _have read_ it well. So that's why didn't ask why the AdminCC is not
notified, because I knew that the script execution is random. Actually,
Notify AdminCcs currently notifies only Queue Watchers. Am I right?
> Caveats
>
> * Triggered scrips prepared without guarantied order.
>
> Nobody guaranty that scrip that notify your admins is executed before
> scrip that adds this admins cause event is the same "On Create".
>
> 2) You can merge this scrips in one.
>
I finally did it in two scripts ;)
> Move your magic AdminCc assign code to scrip that notify people on
> create. But place it in custom condition code. This is required if you
> want your AdminCc be in place before any other code(notify) would be
> executed.
> To preserve meaning of condition "On Create" you should add check:
>
> return 0 unless($self->TransactionObj->Type eq 'Create');
>
I left On Create as it is, in its default configuration. I have another
On Create script with custom action, adding AdminCcs based on certain
criteria (ifs). Then, I have another scrip, with custom condition, which
will be triggered when an AdminCc will be added.
This solution actually is better for me, since it has wider use. The
AdminCc will be notified always, that he/she was added, no matter on the
ticket's stage. Currently, correct me if I'm wrong, an AdminCc will
receive his first email about a ticket, only if a comment/correspondence
will be added.
I want to notify AdminCc right after adding him, since you do not know
when the first transaction (after adding him/her) will occur.
I personally think that my solution is better ;) since I killed two
birds with one stone :) Maybe it's worth to be added to next release of
RT as a default script action? :)
> Best regards. Ruslan.
>
>
Thanks for your help.
Michael
$self->TicketObj->SetStatus('resolved'); :)
More information about the rt-users
mailing list