[rt-users] problems writing a ScripCondition: On Merge

Ruslan U. Zakirov Ruslan.Zakirov at acronis.com
Fri Jan 21 17:34:34 EST 2005


Justin Larue wrote:
> I'm trying to write a scrip condition that will trigger on the merge of
> a ticket.  (The problem I'm solving is that our internal people
> frequently get confused looking for tickets they thought they requested,
> but which got merged into another ticket; an email to them on the merge
> of the ticket would solve thse issues.)
> 
> I've determined that the description of the "Merge" transaction is
> "Merged into ticket #xxx by yyyy" (in this language, anyway), and the
> type of transaction is AddLink.  I tried the fairly unsophisticated
> custom condition:
> 
> return undef unless ($self->TransactionObj->Description =~ /^Merge/);
> return 1;
Description could be localized so you can't relay on it.
Use next:

my $txn = $self->TransactionObj;
return undef unless $txn->Type =~ /^AddLink$/i;
return undef unless $txn->Field =~ /^MergedInto$/i;
return 1;

> 
> but it doesn't trigger, and the Template doesn't seem to get quite the
> same things as the Condition does.  (The wiki suggested I could put
> $TransactionObj->Whatever in the template, but that doesn't actually
> work; it gives an error like "Can't call method "Type" on an undefined
> value".)
You could put { $Transaction->Whatever } in the template. Where exactly 
did you see that on wiki?

> 
> I'm familiar with Perl, but not so much with the layout of RT at this
> point.  Suggestions on where to look for the 'right' way to do this?
> 
> Thanks!
> 
> Justin Larue
> CommPartners
> (702) 367-VOIP (8647) Phone ext. 1022
> (702) 365-VOIP (8647) Fax
> jlarue at commpartners.us
> www.commpartners.us
> 
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
> 
> RT Administrator and Developer training is coming to your town soon! (Boston, San Francisco, Austin, Sydney) Contact training at bestpractical.com for details.
> 
> Be sure to check out the RT Wiki at http://wiki.bestpractical.com




More information about the rt-users mailing list