Hello everyone,

I am trying to add the date to the subject line that rt generates. for
example [rtname #260208-101]
I adjusted as follows:

sub SetSubjectToken {
    my $self = shift;
    my $sub  = $self->TemplateObj->MIMEObj->head->get('Subject');
    my $id   = $self->TicketObj->id;

    my $token_re = $RT::EmailSubjectTagRegex;
    $token_re = qr/\Q$RT::rtname\E/o unless $token_re;
    return if $sub =~ /\[$token_re\s+# strftime('%d%m%y', @{[localtime()]})
-$id\]/;

    $sub =~ s/(\r\n|\n|\s)/ /gi;
    chomp $sub;
    $self->TemplateObj->MIMEObj->head->replace(
        Subject => "[$RT::rtname #" . strftime('%d%m%y', @{[localtime()]}) .
"-$id] $sub",
    );

Works perfectly when creating a ticket, but whenever replying to the ticket
a new ticket is created.
I believe it has to do with     return if $sub =~ /\[$token_re\s+#
strftime('%d%m%y', @{[localtime()]}) -$id\]/;

I hardly know perl and was available to google appending strings in perl.
But the above I do not know how to figure out.

Any help would be appreciated.
}


-- 
- - Sharlon (c).
_______________________________________________
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

Reply via email to