[rt-users] How to access X-RT-Interface header from On Create scrip?
Marcos Orallo
m_orallo at yahoo.es
Wed Jul 8 03:51:53 EDT 2015
Hello,
I don't know if an elegant solution using X-RT-Interface is possible, but I
can give a workaround. This is the custom condition we use to separate
ticket creation from web and mail:
<pre>
# Custom condition to notify when a ticket is created from e-mail
# Based on "OnCreateFromEmail"
# http://requesttracker.wikia.com/wiki/OnCreateFromEmail
my $trans = $self->TransactionObj;
return 0 unless $trans->Type eq "Create";
my $msgattr = $trans->Message->First;
return 0 unless $msgattr;
return 0 unless $msgattr->GetHeader('Received');
return 1;
</pre>
I hope it helps.
2015-07-07 3:16 GMT+02:00 Russell Jones <russell at jonesmail.me>:
> I am trying to access the new X-RT-Interface header in order to determine
> within a Scrip if a ticket was created via Email or Web. However whenever I
> try to create a new ticket and use an On Create scrip to read this header,
> I get errors saying "Can't call method "GetHeader" on an undefined value".
>
> Can anyone please provide an example of how to properly access this header?
>
> Thank you!
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20150708/747cfcef/attachment.htm>
More information about the rt-users
mailing list