solved! Re: [rt-users] After Update Relationships are lost!

Bruce Campbell bruce_campbell at ripe.net
Wed Nov 21 06:58:36 EST 2001


On Wed, 21 Nov 2001, Bruce Campbell wrote:

> On Wed, 21 Nov 2001, Andreas Kruthoff wrote:
>
> > Please do not ever change the "$rtname" variable in etc/config.pm of rt, if
> > you have already tickets in the database! This is written in the config
> > file itself ;-)
>
> Ok, how about this concept;
>
> 	One Organisation.
> 	Multiple Ticket queues
> 	*Seperate* Numbering systems for each queue.
>
> Is it possible to use one SQL database, and multiple $rtname variables to
> seperate out the queues ?

Hrm, this isn't what I want.  $rtname appears to be used for:

	Pretty naming of Web Pages  (RT/$rtname)
	Ticket Acknowledgements
	Mail loop detection	(X-RT-Loop-Prevention: $rtname)
	Self-check on incoming tickets (subject line match)
	Identifier on outgoing tickets
	Other misc things which don't seem to be important ;)

$rtname isn't actually stored in the SQL database, leading to the
conclusion of one RT2 instance, one number sequence irrespective of number
of queues.  Poot.

As an aside, I'd suggest another feeping creaturism, being to support
migration from previous ticketing systems which had a different identifier
($rtname) in the subject line, but *where the same numbering system has
been preserved in conversion from previous ticketing system to RT2*, ie:

	etc/config.pm:
--
		# Incoming subject line match to assist with migration
		rtname_regex = "^\s*\[(old-org-name|new-org-name)\s+\#(\d+)\]\s*";

		# Field within pattern match which has the ticket $Id
		# See perlre man page - 1-9 is the limit
		rtname_regex_Id = 2;
--

	lib/RT/Interface/Email.pm - ParseTicketId():
--
	    my $retval = undef;
	    if ($Subject =~ s/\[$RT::rtname \#(\d+)\]//i) {
	        $Id = $1;
	        $RT::Logger->debug("Found a ticket ID. It's $Id");
		$retval = $Id;
	    }
	    elsif ( defined( $RT::rtname_regex ) && defined( $RT::rtname_regex_Id ) ) {
	        if ( $RT::rtname_regex_Id =~ m/^\d+$/ && $Subject =~ m/$RT::rtname_regex/i ) {
			my (@tsplit) = ("", $1, $2, $3, $4, $5, $6, $7, $8, $9);
			if( defined( $tsplit[$RT::rtname_regex_Id] ) ) {
				# Paranoia checks just in case the local
				# administrator didn't quite specify a
				# number pattern match.  Avoid possible
				# problems later when SQL gets involved.
				my $tval = $tsplit[$RT::rtname_regex_Id];
			        $RT::Logger->debug("Found a possible ticket ID.  It's $tval");
				$retval = $tval if( $tval =~ /^\d+$/ );
			}
		}
	    }

	    return( $retval );
--

Ie, if you previously generated tickets like [some_name #1234] and now are
[some_other_name #4321], but do want to preserve continuity to your users
without dropping tickets.


-- 
                             Bruce Campbell                            RIPE
                                                                        NCC
                                                                 Operations





More information about the rt-users mailing list