[rt-users] TransactionBatch and TransactionCreate [mx]]

Ruslan U. Zakirov cubic at acronis.ru
Thu Aug 5 13:48:03 EDT 2004


Michael Bochynski wrote:
>>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?
No.
 From lib/RT/Action/Notify.pm (3.0-MAINT at HEAD)
if ( $arg =~ /\bAdminCc\b/ ) {
  push ( @Bcc, $self->TicketObj->AdminCc->MemberEmailAddresses  );
  push ( @Bcc, $self->TicketObj->QueueObj->AdminCc->MemberEmailAddresses);
}

> 
> 
>>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 ;)
Cool.

> 
>>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 is good solution.

> 
> 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.
Good scrip condition. Please add it to wiki.

> 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.
You loose only one transaction when your scrip(that adds AdminCc) 
trigger and exactly this transaction also trigger notification. On all 
other subsequent transactions your AdminCcs would be on thier places.

> 
> 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? :)
You can share it and if people find it useful. Then RT someday would 
have something that override it functionality and may be add more.

I prefer some ordering on scrips.

> 
> 
> 
> 
>>				Best regards. Ruslan.
>>
>>
> 
> 
> Thanks for your help.
> Michael
> $self->TicketObj->SetStatus('resolved');  :)
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> 
> Be sure to check out the RT wiki at http://wiki.bestpractical.com




More information about the rt-users mailing list