Hi list,
I¹m trying to create a scip that will add several watchers from a mail body
on ticket creation. It works alright for the first line but can¹t get it to
add several watchers. I¹ve followed
http://wiki.bestpractical.com/view/SetTicketPropertiesViaMail but I¹m not
too confident with perl to get it work.
My message body looks like this:
Set-CC:[EMAIL PROTECTED]
Set-CC:[EMAIL PROTECTED]
Set-CC:[EMAIL PROTECTED]
And my scrip looks like:
my $AttachObj = $self->TransactionObj->Attachments->First;
# go out if content is not text!
unless( $AttachObj->ContentType =~ /^text/ ) {
return 1;
}
my $content = $AttachObj->Content;
if( $content =~ m/^\QSet-CC:\E\s*(\S+)\s*$/m ) {
$self->TicketObj->AddWatcher( Type => "Cc", Email => $1);
}
# strip special commands from email content
$content =~ s/^\QSet-CC:\E\s*(\S+)\s*$//gm;
# silently overwrite attachment content
$AttachObj->__Set( Field => 'Content', Value => $content );
1;
I guess I should make the scrip go through each line but don¹t know how?
Thank in advance
Johan
###########################################
This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange.
For more information, connect to http://www.f-secure.com/_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]
Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at http://rtbook.bestpractical.com