[rt-users] From a template, how do I get a handle to a ticket attachment?

Ole Craig ocraig at stillsecure.com
Wed Sep 13 18:42:00 EDT 2006


(3.6.0/mysql4/CentOS)

>From a template, how can I get at the value of a specific header in the
first email message in a ticket? I know how to get it in a scrip:

my $trans = $self->TransactionObj;
my $msgattr = $trans->Message->First;
my $headerval = $msgattr->GetHeader('X-MY-HEADER');

...but when I try to do that from template context I get this:

[Tue Sep 12 11:33:25 2006] [error]: Template parsing error: Can't call
method "TransactionObj" on an undefined value at template line 1.

Background: I want to fire a pager if RT gets an email with a particular
value in the "to" header, and I want to extract information from that
header and put it into the email that gets sent to the pager, hence the
need to have a handle to it in the template.

Alternatively, how can I pass a value from a scrip to the template it
calls? I have a scrip with a custom condition that's firing just fine,
using the snippet above to look for my keyword in the headers of the
email that creates a ticket. If I can pass a variable from that scrip to
the template I wouldn't need to duplicate the calls...

	Thanks for any helpful thoughts,
		Ole


-- 
/Ole Craig
Security Engineer
Team lead, customer support

303-381-3802 (main support hotline)
303-381-3824 (my direct line)
303-381-3801 (fax)

www.stillsecure.com
. . .



More information about the rt-users mailing list