Old RT and New RT?

An udate on this issue.

I know many of you would rather do it differently , but i would like to
request any info on the way i have been asked to do this . That is , to
extract ticket id from subject and then forward this email to the old rt .
am i correct in thinking that i would need a perl function to do ?
or something else ? basically need to get the ticket id out from subject of
email which is written in a tmp file .

someone with experience in this can help me out ?

thanks

aseim99 wrote:

Hello we have an old RT , i think its 3.6 . Now we are planing on
deploying new one i.e 3.8.
My question is that we will like old tickets to still go to old rt system
and any tickets above 10,000 id number will go to new system. So in
essence the mail gateway or something else ? will forward tickets having
id number less that 10,000 to the old rt and anything above that will go
to new rt with new queues on new rt. Then after some time we will disable
the old system and only new one will be there , this is to avoid any
downtime.
RT is a brilliant system and we are looking to use it more , but this
needs to be possible or my manager wont go ahead with the new system.
Any suggestions and helps much appreciated.
Cheers

View this message in context: http://old.nabble.com/Old-RT-and-New-RT---tp31558446p31593916.html

I’ve only had the time for a brief look at the code, but I’d suggest at around line 123 of rt-mailgate (in 3.8.8 at least. The $full_url line), you break up $opt{‘headers’} by line, iterate through the resulting list, find the line starting subject:, then look to see if the subject matches [tag #\d{1,4}]. If it does, set $full_url to point at your old instance. If it doesn’t, then your new one.

Bear in mind I’ve not tested this in any way, shape or form, you should edit in a copy of the file, and hook it up to a different email so you can test it without screwing up your old system.

You might also just want to try a different tag, rather than keeping it the same on both. Makes the matching easier than the full regex.

Instead of:
my $full_url = $opts{‘url’}. “/REST/1.0/NoAuth/mail-gateway”;

have:

my $full_url=“http://NewRTInstance/REST/1.0/NoAuth/mail-gateway”;
foreach my $line (split(/\n/,$opt{‘headers’}))
{
if ($line ~= /^\tsubject:/i)
{
if($line ~=/[tag #\d{1,4}]/i)
{
$full_url=" http://OldRTInstance/REST/1.0/NoAuth/mail-gateway";
}
}
}

Bear in mind, email’s probably screwed this up.

Steve Anderson.From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of aseim99
Sent: 11 May 2011 13:50
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Old RT and New RT ?

An udate on this issue.

I know many of you would rather do it differently , but i would like to
request any info on the way i have been asked to do this . That is , to
extract ticket id from subject and then forward this email to the old rt .
am i correct in thinking that i would need a perl function to do ?
or something else ? basically need to get the ticket id out from subject of
email which is written in a tmp file .

someone with experience in this can help me out ?

thanks

aseim99 wrote:

Hello we have an old RT , i think its 3.6 . Now we are planing on
deploying new one i.e 3.8.
My question is that we will like old tickets to still go to old rt system
and any tickets above 10,000 id number will go to new system. So in
essence the mail gateway or something else ? will forward tickets having
id number less that 10,000 to the old rt and anything above that will go
to new rt with new queues on new rt. Then after some time we will disable
the old system and only new one will be there , this is to avoid any
downtime.
RT is a brilliant system and we are looking to use it more , but this
needs to be possible or my manager wont go ahead with the new system.
Any suggestions and helps much appreciated.
Cheers

View this message in context: http://old.nabble.com/Old-RT-and-New-RT---tp31558446p31593916.html

This email has been scanned by Netintelligence
http://www.netintelligence.com/email

BiP Solutions Limited is a company registered in Scotland with Company
Number SC086146 and VAT number 383030966 and having its registered
office at Medius, 60 Pacific Quay, Glasgow, G51 1DZ.

This e-mail (and any attachment) is intended only for the attention of
the addressee(s). Its unauthorised use, disclosure, storage or copying
is not permitted. If you are not the intended recipient, please destroy
all copies and inform the sender by return e-mail.
This e-mail (whether you are the sender or the recipient) may be
monitored, recorded and retained by BiP Solutions Ltd.
E-mail monitoring/ blocking software may be used, and e-mail content may
be read at any time.You have a responsibility to ensure laws are not
broken when composing or forwarding e-mails and their contents.

Hello mate, thanks for that code.
I am getting this following error.

Global symbol “%opt” requires explicit package name at ./rt-mailgate line
152.
syntax error at ./rt-mailgate line 154, near "$line ~"
Execution of ./rt-mailgate aborted due to compilation errors.

aseim99 wrote:

Hello we have an old RT , i think its 3.6 . Now we are planing on
deploying new one i.e 3.8.
My question is that we will like old tickets to still go to old rt system
and any tickets above 10,000 id number will go to new system. So in
essence the mail gateway or something else ? will forward tickets having
id number less that 10,000 to the old rt and anything above that will go
to new rt with new queues on new rt. Then after some time we will disable
the old system and only new one will be there , this is to avoid any
downtime.
RT is a brilliant system and we are looking to use it more , but this
needs to be possible or my manager wont go ahead with the new system.
Any suggestions and helps much appreciated.
Cheers

View this message in context: http://old.nabble.com/Old-RT-and-New-RT---tp31558446p31594199.html

Bah! I missed an s. As I said, I’ve not tested it :wink:

my $full_url=“http://NewRTInstance/REST/1.0/NoAuth/mail-gateway”;
foreach my $line (split(/\n/,$opts{‘headers’}))
{
if ($line ~= /^\tsubject:/i)
{
if($line ~=/[tag #\d{1,4}]/i)
{
$full_url=" http://OldRTInstance/REST/1.0/NoAuth/mail-gateway";
}
}
}From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of aseim99
Sent: 11 May 2011 14:26
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Old RT and New RT ?

Hello mate, thanks for that code.
I am getting this following error.

Global symbol “%opt” requires explicit package name at ./rt-mailgate line
152.
syntax error at ./rt-mailgate line 154, near "$line ~"
Execution of ./rt-mailgate aborted due to compilation errors.

aseim99 wrote:

Hello we have an old RT , i think its 3.6 . Now we are planing on
deploying new one i.e 3.8.
My question is that we will like old tickets to still go to old rt system
and any tickets above 10,000 id number will go to new system. So in
essence the mail gateway or something else ? will forward tickets having
id number less that 10,000 to the old rt and anything above that will go
to new rt with new queues on new rt. Then after some time we will disable
the old system and only new one will be there , this is to avoid any
downtime.
RT is a brilliant system and we are looking to use it more , but this
needs to be possible or my manager wont go ahead with the new system.
Any suggestions and helps much appreciated.
Cheers

View this message in context: http://old.nabble.com/Old-RT-and-New-RT---tp31558446p31594199.html

This email has been scanned by Netintelligence
http://www.netintelligence.com/email

BiP Solutions Limited is a company registered in Scotland with Company
Number SC086146 and VAT number 383030966 and having its registered
office at Medius, 60 Pacific Quay, Glasgow, G51 1DZ.

This e-mail (and any attachment) is intended only for the attention of
the addressee(s). Its unauthorised use, disclosure, storage or copying
is not permitted. If you are not the intended recipient, please destroy
all copies and inform the sender by return e-mail.
This e-mail (whether you are the sender or the recipient) may be
monitored, recorded and retained by BiP Solutions Ltd.
E-mail monitoring/ blocking software may be used, and e-mail content may
be read at any time.You have a responsibility to ensure laws are not
broken when composing or forwarding e-mails and their contents.

Ok folks , this is what i have done .

In rt-mailgate under /etc/smrsh/ i have created a sub:

sub get_id
{
my $key1;
my $value1;
while ( my ($key1, $value1) = each(%message) )
{
open (FILE, $value1)
or die "Could not open ";
my @array = ;
my $element = ‘subject’;

    if(my @found = grep(/\b$element\b/i,@array))
     {
      my $output = join(",", @found);
       $output =~s/,*$//;
        my $start = index($output,"#");
        if($start > -1)
           {
              my $end = index($output,"]",$start);
              if($end > -1)
                  {
                    my $myticket = substr($output,$start +1

,$end-$start-1);
return($myticket);
}
return (-1);
}
}
}
}

Then in the code , after *read message from stdin *

my $tickNo = get_id();
if($tickNo == -1){
print STDERR “New Ticket \n”;
}
elsif ($tickNo >10000){
print STDERR “Send To new System \n”;

}
else{
$destUrl = $opts{‘otherurl’};
print STDERR “Send To Old System \n”;

}
print STDERR “$tickNo \n”;

BUT the problem here is the way i managed to get the ticketnumber extracted
from %message.

This %message in rt is used first as

my %message = write_down_message();

does it mean this is a global hash variable ? which to my understanding is
not good practice i.e global variables should not be used.
Is there a way that i can extract ticket number from the
write_message_down() function rather than using a global variable ?

hope that makes sense .
cheers

Steve Anderson-5 wrote:

Bah! I missed an s. As I said, I’ve not tested it :wink:

my $full_url=“http://NewRTInstance/REST/1.0/NoAuth/mail-gateway”;
foreach my $line (split(/\n/,$opts{‘headers’}))
{
if ($line ~= /^\tsubject:/i)
{
if($line ~=/[tag #\d{1,4}]/i)
{
$full_url=" http://OldRTInstance/REST/1.0/NoAuth/mail-gateway";
}
}
}

-----Original Message-----
From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of aseim99
Sent: 11 May 2011 14:26
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Old RT and New RT ?

Hello mate, thanks for that code.
I am getting this following error.

Global symbol “%opt” requires explicit package name at ./rt-mailgate line
152.
syntax error at ./rt-mailgate line 154, near "$line ~"
Execution of ./rt-mailgate aborted due to compilation errors.

aseim99 wrote:

Hello we have an old RT , i think its 3.6 . Now we are planing on
deploying new one i.e 3.8.
My question is that we will like old tickets to still go to old rt system
and any tickets above 10,000 id number will go to new system. So in
essence the mail gateway or something else ? will forward tickets having
id number less that 10,000 to the old rt and anything above that will go
to new rt with new queues on new rt. Then after some time we will disable
the old system and only new one will be there , this is to avoid any
downtime.
RT is a brilliant system and we are looking to use it more , but this
needs to be possible or my manager wont go ahead with the new system.
Any suggestions and helps much appreciated.
Cheers


View this message in context:
http://old.nabble.com/Old-RT-and-New-RT---tp31558446p31594199.html
Sent from the Request Tracker - User mailing list archive at Nabble.com.


This email has been scanned by Netintelligence
http://www.netintelligence.com/email

BiP Solutions Limited is a company registered in Scotland with Company
Number SC086146 and VAT number 383030966 and having its registered
office at Medius, 60 Pacific Quay, Glasgow, G51 1DZ.


This e-mail (and any attachment) is intended only for the attention of
the addressee(s). Its unauthorised use, disclosure, storage or copying
is not permitted. If you are not the intended recipient, please destroy
all copies and inform the sender by return e-mail.
This e-mail (whether you are the sender or the recipient) may be
monitored, recorded and retained by BiP Solutions Ltd.
E-mail monitoring/ blocking software may be used, and e-mail content may
be read at any time.You have a responsibility to ensure laws are not
broken when composing or forwarding e-mails and their contents.


View this message in context: http://old.nabble.com/Old-RT-and-New-RT---tp31558446p31646721.html