Is there a way to search the contents of a transaction on ticket creator so i
can find an email address within the transaction and then use that email
address as the requestor of the new ticket
i have been able to setup a small scrip that will switch between 2 hard
coded requestors but i just dont know how to find the email address stored
within the transactions.
each new ticket on our RT system will be generated when the user fills out
an online form, our website then sends this to our RT system but it contains
the websites email address and not the users who filled in the form.
each transaction will contain something like the following
There has been a message sent via the technical support form
Contact Name: Scott
Company Name: Company
Contact Email Add: email@address
Contact Tel: 123 456789
Licence Number: 12.23.45.56
Version Number: 1.2.3.45
Software Product: product
Country: country
Problem: a description of the issue faced by the customer
if anyone could point me in the right direction that would be great
thank you
Scott
View this message in context: http://requesttracker.8502.n7.nabble.com/How-can-i-search-the-contents-of-a-transaction-when-creating-a-new-ticket-tp55795.html
solved my own problem.
first it searches for the requestors email address or reference number
matches a certain value
if it does it will then chop up the standard emails contents to get the
users email address
it will then remove the old requestor and add the new requestor
#Variables
my $trans = $self->TransactionObj;
my $ticket = $self->TicketObj;
my $trigger =“No”;
my $EmailBad = ‘website-no-reply@lfm-software.com’;
my $out=“”;
my $length=0;
my $fragment=“”;
my $fragmentSearch1="Contact Email Add: ";
my $fragmentSearch2=“Contact Tel:”;
#Set Trigger for switching scrip on
if ($trans->Creator()==‘11434’){
$trigger=“YES”;
}
if($ticket->IsWatcher( Type=>“Requestor”, Email => $EmailBad)){
$trigger=“YES”;
}
if ($trigger eq ‘YES’){
#get contents and return email address
$out=$trans->Content();
$length = length($out);
$fragment = substr $out, index($out, $fragmentSearch1);
$fragment = substr $fragment,
length($fragmentSearch1),(-1*(length($fragment)-index($fragment,
$fragmentSearch2)));
#removes one requestor and replaces it with an other
$ticket->DeleteWatcher( Type=>“Requestor”, Email => $EmailBad);
$ticket->AddWatcher(Type => “Requestor”, Email => $fragment);
return 1;
}
its might not be the most elegant way of doing it but it does the job
View this message in context: http://requesttracker.8502.n7.nabble.com/How-can-i-search-the-contents-of-a-transaction-when-creating-a-new-ticket-tp55795p55797.html