[rt-users] Disabled item in Custom Field?

2007-01-06 Thread Mathew Snyder
We have a Select Multiple type custom field which lists all of our customers'
company names.  Every now and then a customer either changes its name or does
something that affects what we call it in our list.  Sometimes this simply
requires adding the new name, updating all the tickets labeled with the old one
by labeling them with the new name and then deleting the old one.  However,
sometimes we need to keep the tickets created under the old name as they are
while all new tickets get the new name.

This leads me to my question.  Or more accurately, a feature request.  It would
be nice to maintain items in a list such as the one I described but be able to
mark them as disabled so they don't show up when selecting from the list.
Perhaps in doing so, on the Query Builder page a separate list can be built up
from the disabled items so that they are still searchable.

Is this feasible?

Mathew
___
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


Re: [rt-users] Shredder API questions

2007-01-06 Thread Ruslan Zakirov

On 12/30/06, Mathew Snyder <[EMAIL PROTECTED]> wrote:

I'm rewriting a script that will eliminate all spam users accrued over the
course of a day.  Presently, it is using the least efficient way of executing
the wipeout by performing a system call to rtx-shredder.  I would prefer to run
the wipeout by way of the Shredder API.  I'm guessing along the lines of this:

# load plugin by preformatted string
my $pluginString = "'Users=status,any;email,$email;replace_relations,Nobody'";
my $plugin = new RTx::Shredder::Plugin;
my( $status, $msg ) = $plugin->LoadByString( $pluginString );
unless( $status ) {
print STDERR "Couldn't load plugin: $msg\n";
exit(1);
}
}

Another question is in regards to the sql dump.  I've looked at rtx-shredder and
have seen referrence to the SetFile method but haven't seen anything about the
DumpSQl method that is mentioned in Shredder.pm.  Is this automatically
accounted for when if I use my ($fname, $fh) = $shredder-SetFile;?

The portion of my script this relates to is below.


foreach my $email (sort(@emails)){
print $email . "\n";
}

print "\nDelete the email addresses from the RT database [y/N]: ";
chomp($ans = );

if ($ans =~ m/^(y|yes)$/i){
my $email;
foreach $email (@emails){
#   system "/usr/local/rt-3.6.1/local/sbin/rtx-shredder --force --plugin \
'Users=status,any;email,$email;replace_relations,Nobody'";
# load plugin by preformatted string
my $pluginString = \
"'Users=status,any;email,$email;replace_relations,Nobody'";
my $plugin = new RTx::Shredder::Plugin;
my( $status, $msg ) = $plugin->LoadByString( $pluginString );
unless( $status ) {
print STDERR "Couldn't load plugin: $msg\n";
exit(1);
}
}
}
else{
exit;
}


One problem I can already see with the above snippet is that Shredder is called
seperately for each email address.  How do I set this up to run as one
continuous execution for the entire array of addresses?

You can use $shredder->PutObject and put sever users' objects into
shredder and then $shredder->WipeoutAll.



Any and all help will be greatly appreciated.

Mathew
___
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




--
Best regards, Ruslan.
___
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


Re: [rt-users] Shredder problems "objects list is empty"

2007-01-06 Thread Ruslan Zakirov

I really tried to reproduce this problem, but without any luck.
Could turn on database query log?

On 1/3/07, Pete Phillips <[EMAIL PROTECTED]> wrote:

I'm trying to delete spam addresses from RT 3.4.2, vanilla install, with
the latest shredder from CPAN.

If I run this command:

 /opt/rt3/local/sbin/rtx-shredder  --plugin
"Users=status,any;email,[EMAIL PROTECTED]"

I get this:

SQL dump file is '/tmp/20061215T134640-0001.sql'
Objects list is empty, try refine search options

The address I use is definitely in the database.

Any help appreciated.
Regards,
Pete


[Apols for the repost - I just realised I posted this as a reply to a
different post, so it ended up in an unrelated thread.  ]
___
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




--
Best regards, Ruslan.
___
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


[rt-users] Problems with mail interface (fresh install)

2007-01-06 Thread Jakub Drwal
Hello,

 I've just installed fresh instance of request tracker on one box, and
 I have this problem with e-mail ticket creation interface:

echo test|/var/www/rt.ikarnet.pl/rt-3.6.3/bin/rt-mailgate --url 
http://rt.ikarnet.pl/ --debug --action correspond
Connecting to http://rt.ikarnet.pl//REST/1.0/NoAuth/mail-gateway at 
/var/www/rt.ikarnet.pl/rt-3.6.3/bin/rt-mailgate line 100, <> line 1.
not ok - Could not load a valid user at 
/var/www/rt.ikarnet.pl/rt-3.6.3/bin/rt-mailgate line 109, <> line 1.

I found another error on apache log:
[Sat Jan  6 21:50:44 2007] [error]: Could not record email: Could not load a 
valid user (/var/www/rt.ikarnet.pl/htdocs/rt/REST/1.0/NoAuth/mail-gateway:73)

I spend few hours googling and trying what is the cause of problem,
but I got nothing :(

Anyone can help?


-- 
Jakub Drwal
Studencki Klub Sieci Komputerowych IkarNet
http://IkarNet.pl

___
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


Re: [rt-users] Shredder API questions

2007-01-06 Thread Mathew Snyder
Ruslan Zakirov wrote:
> On 12/30/06, Mathew Snyder <[EMAIL PROTECTED]> wrote:
>> I'm rewriting a script that will eliminate all spam users accrued over
>> the
>> course of a day.  Presently, it is using the least efficient way of
>> executing
>> the wipeout by performing a system call to rtx-shredder.  I would
>> prefer to run
>> the wipeout by way of the Shredder API.  I'm guessing along the lines
>> of this:
>>
>> # load plugin by preformatted string
>> my $pluginString =
>> "'Users=status,any;email,$email;replace_relations,Nobody'";
>> my $plugin = new RTx::Shredder::Plugin;
>> my( $status, $msg ) = $plugin->LoadByString( $pluginString );
>> unless( $status ) {
>> print STDERR "Couldn't load plugin: $msg\n";
>> exit(1);
>> }
>> }
>>
>> Another question is in regards to the sql dump.  I've looked at
>> rtx-shredder and
>> have seen referrence to the SetFile method but haven't seen anything
>> about the
>> DumpSQl method that is mentioned in Shredder.pm.  Is this automatically
>> accounted for when if I use my ($fname, $fh) = $shredder-SetFile;?
>>
>> The portion of my script this relates to is below.
>>
>> 
>> foreach my $email (sort(@emails)){
>> print $email . "\n";
>> }
>>
>> print "\nDelete the email addresses from the RT database [y/N]: ";
>> chomp($ans = );
>>
>> if ($ans =~ m/^(y|yes)$/i){
>> my $email;
>> foreach $email (@emails){
>> #   system "/usr/local/rt-3.6.1/local/sbin/rtx-shredder --force
>> --plugin \
>> 'Users=status,any;email,$email;replace_relations,Nobody'";
>> # load plugin by preformatted string
>> my $pluginString = \
>> "'Users=status,any;email,$email;replace_relations,Nobody'";
>> my $plugin = new RTx::Shredder::Plugin;
>> my( $status, $msg ) = $plugin->LoadByString(
>> $pluginString );
>> unless( $status ) {
>> print STDERR "Couldn't load plugin: $msg\n";
>> exit(1);
>> }
>> }
>> }
>> else{
>> exit;
>> }
>> 
>>
>> One problem I can already see with the above snippet is that Shredder
>> is called
>> seperately for each email address.  How do I set this up to run as one
>> continuous execution for the entire array of addresses?
> You can use $shredder->PutObject and put sever users' objects into
> shredder and then $shredder->WipeoutAll.
> 
I've tried
foreach my $email (@emails) {
$shredder->PutObject (User => $email);
}

$shredder->PutObject (User::LoadByEmail => $email);
$shredder->PutObject (RT::User::LoadByEmail => $email);
and
$shredder->PutObject ($email);

I'm getting
Odd number of elements in anonymous hash at
/usr/local/rt-3.6.1/local/lib/RTx/Shredder.pm line 177,  line 1.
Use of uninitialized value in anonymous hash ({}) at
/usr/local/rt-3.6.1/local/lib/RTx/Shredder.pm line 177,  line 1.
Odd number of elements in hash assignment at
/usr/local/rt-3.6.1/local/lib/RTx/Shredder.pm line 287,  line 1.
Unsupported type '(undef)'

Trace begun at /usr/local/rt-3.6.1/local/lib/RTx/Shredder.pm line 290
RTx::Shredder::PutObject('RTx::Shredder=HASH(0xa283e64)',
'[EMAIL PROTECTED]') called at delete_spam_users.pl line 65

I looked at line 177 in Shredder and couldn't figure out what I was looking at.
 I also looked at the perldoc for Shredder.pm, User.pm, Users.pm and Record.pm.

I don't know what I'm missing.

Mathew
___
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


Re: [rt-users] Shredder API questions

2007-01-06 Thread Mathew Snyder
Ruslan Zakirov wrote:
> On 12/30/06, Mathew Snyder <[EMAIL PROTECTED]> wrote:
>> I'm rewriting a script that will eliminate all spam users accrued over
>> the
>> course of a day.  Presently, it is using the least efficient way of
>> executing
>> the wipeout by performing a system call to rtx-shredder.  I would
>> prefer to run
>> the wipeout by way of the Shredder API.  I'm guessing along the lines
>> of this:
>>
>> # load plugin by preformatted string
>> my $pluginString =
>> "'Users=status,any;email,$email;replace_relations,Nobody'";
>> my $plugin = new RTx::Shredder::Plugin;
>> my( $status, $msg ) = $plugin->LoadByString( $pluginString );
>> unless( $status ) {
>> print STDERR "Couldn't load plugin: $msg\n";
>> exit(1);
>> }
>> }
>>
>> Another question is in regards to the sql dump.  I've looked at
>> rtx-shredder and
>> have seen referrence to the SetFile method but haven't seen anything
>> about the
>> DumpSQl method that is mentioned in Shredder.pm.  Is this automatically
>> accounted for when if I use my ($fname, $fh) = $shredder-SetFile;?
>>
>> The portion of my script this relates to is below.
>>
>> 
>> foreach my $email (sort(@emails)){
>> print $email . "\n";
>> }
>>
>> print "\nDelete the email addresses from the RT database [y/N]: ";
>> chomp($ans = );
>>
>> if ($ans =~ m/^(y|yes)$/i){
>> my $email;
>> foreach $email (@emails){
>> #   system "/usr/local/rt-3.6.1/local/sbin/rtx-shredder --force
>> --plugin \
>> 'Users=status,any;email,$email;replace_relations,Nobody'";
>> # load plugin by preformatted string
>> my $pluginString = \
>> "'Users=status,any;email,$email;replace_relations,Nobody'";
>> my $plugin = new RTx::Shredder::Plugin;
>> my( $status, $msg ) = $plugin->LoadByString(
>> $pluginString );
>> unless( $status ) {
>> print STDERR "Couldn't load plugin: $msg\n";
>> exit(1);
>> }
>> }
>> }
>> else{
>> exit;
>> }
>> 
>>
>> One problem I can already see with the above snippet is that Shredder
>> is called
>> seperately for each email address.  How do I set this up to run as one
>> continuous execution for the entire array of addresses?
> You can use $shredder->PutObject and put sever users' objects into
> shredder and then $shredder->WipeoutAll.
> 
I've tried
foreach my $email (@emails) {
$shredder->PutObject (User => $email);
}

$shredder->PutObject (User::LoadByEmail => $email);
$shredder->PutObject (RT::User::LoadByEmail => $email);
and
$shredder->PutObject ($email);

I'm getting
Odd number of elements in anonymous hash at
/usr/local/rt-3.6.1/local/lib/RTx/Shredder.pm line 177,  line 1.
Use of uninitialized value in anonymous hash ({}) at
/usr/local/rt-3.6.1/local/lib/RTx/Shredder.pm line 177,  line 1.
Odd number of elements in hash assignment at
/usr/local/rt-3.6.1/local/lib/RTx/Shredder.pm line 287,  line 1.
Unsupported type '(undef)'

Trace begun at /usr/local/rt-3.6.1/local/lib/RTx/Shredder.pm line 290
RTx::Shredder::PutObject('RTx::Shredder=HASH(0xa283e64)',
'[EMAIL PROTECTED]') called at delete_spam_users.pl line 65

I looked at line 177 in Shredder and couldn't figure out what I was looking at.
 I also looked at the perldoc for Shredder.pm, User.pm, Users.pm and Record.pm.

I don't know what I'm missing.

Mathew

___
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