Re: [rt-users] CLI question

2013-09-11 Thread Ruslan Zakirov
Hi,

It's very much expected for seconds to be there if the data is from DB. Can
you describe situation in more details?


On Mon, Sep 9, 2013 at 6:16 PM, Nathan Cutler wrote:

> In case anyone is interested, I patched the 'rt' script to fix the problem:
>
> # diff -u rt.old rt
> --- rt.old  2013-08-14 20:46:23.0 +0200
> +++ rt  2013-09-09 16:06:20.0 +0200
> @@ -1698,6 +1698,8 @@
>  $mon = $month{$monstr} if exists $month{$monstr};
>  } elsif ( /(\d{4})-(\d\d)-(\d\d)\s+(\d\d):(\d\d):(\d\d)/ ) {
>  ($yr, $mon, $day, $hr, $min, $sec) = ($1, $2-1, $3, $4, $5, $6);
> +} elsif ( /(\d{4})-(\d\d)-(\d\d)\s+(\d\d):(\d\d)/ ) {
> +($yr, $mon, $day, $hr, $min, $sec) = ($1, $2-1, $3, $4, $5, 0);
>  }
>  if ( $yr and defined $mon and $day and defined $hr and defined $sec )
> {
>  return timelocal($sec,$min,$hr,$day,$mon,$yr);
>
> Now the 'rt list' command works as expected.
>
> Nathan
>
>
> On Thu, Sep 5, 2013 at 4:40 PM, Nathan Cutler 
> wrote:
> > I'm trying to use the 'rt' command line script. It's working, except
> > for an annoying error message:
> >
> > $ rt list "status='new'"
> > Query:status='new'
> > Ticket Owner QueueAge   Told Status Requestor Subject
> >
> 
> > Unknown date format in parsedate: '2011-09-30 13:44'
> >
> > This "Unknown date format" error is written once for each line of output.
> >
> > Reading the code, I can see that RT is expecting the date format to
> > include the seconds, yet in my case the seconds are missing.
> >
> > I can patch the code to add ":00" on the end, but I'm curious to hear
> > if others can reproduce this, or any ideas for a proper fix.
> >
> > Thanks!
> >
> > Nathan
>



-- 
Best regards, Ruslan.


Re: [rt-users] CLI question

2013-09-09 Thread Nathan Cutler
In case anyone is interested, I patched the 'rt' script to fix the problem:

# diff -u rt.old rt
--- rt.old  2013-08-14 20:46:23.0 +0200
+++ rt  2013-09-09 16:06:20.0 +0200
@@ -1698,6 +1698,8 @@
 $mon = $month{$monstr} if exists $month{$monstr};
 } elsif ( /(\d{4})-(\d\d)-(\d\d)\s+(\d\d):(\d\d):(\d\d)/ ) {
 ($yr, $mon, $day, $hr, $min, $sec) = ($1, $2-1, $3, $4, $5, $6);
+} elsif ( /(\d{4})-(\d\d)-(\d\d)\s+(\d\d):(\d\d)/ ) {
+($yr, $mon, $day, $hr, $min, $sec) = ($1, $2-1, $3, $4, $5, 0);
 }
 if ( $yr and defined $mon and $day and defined $hr and defined $sec ) {
 return timelocal($sec,$min,$hr,$day,$mon,$yr);

Now the 'rt list' command works as expected.

Nathan


On Thu, Sep 5, 2013 at 4:40 PM, Nathan Cutler  wrote:
> I'm trying to use the 'rt' command line script. It's working, except
> for an annoying error message:
>
> $ rt list "status='new'"
> Query:status='new'
> Ticket Owner QueueAge   Told Status Requestor Subject
> 
> Unknown date format in parsedate: '2011-09-30 13:44'
>
> This "Unknown date format" error is written once for each line of output.
>
> Reading the code, I can see that RT is expecting the date format to
> include the seconds, yet in my case the seconds are missing.
>
> I can patch the code to add ":00" on the end, but I'm curious to hear
> if others can reproduce this, or any ideas for a proper fix.
>
> Thanks!
>
> Nathan


[rt-users] CLI question

2013-09-05 Thread Nathan Cutler
I'm trying to use the 'rt' command line script. It's working, except
for an annoying error message:

$ rt list "status='new'"
Query:status='new'
Ticket Owner QueueAge   Told Status Requestor Subject

Unknown date format in parsedate: '2011-09-30 13:44'

This "Unknown date format" error is written once for each line of output.

Reading the code, I can see that RT is expecting the date format to
include the seconds, yet in my case the seconds are missing.

I can patch the code to add ":00" on the end, but I'm curious to hear
if others can reproduce this, or any ideas for a proper fix.

Thanks!

Nathan


[rt-users] CLI question

2008-10-17 Thread Roy El-Hames
Hi ;

Using rt-3.6.3

Is there a bug in using:
./rt edit ticket/$tid add cc="[EMAIL PROTECTED]"
 or am i doing something wrong, I get back # Syntax error. and the 
ticket detail (as if show ticket) ;

the add seems not to work with anything add bcc or add CF- do not work 
either ??
Similar the del method is not working either ??

Thanks;
Roy



___
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] CLI question

2008-06-05 Thread Kenneth Crocker
To all RT users,


I wanted to know if I could use CLI to "batch create" a bunch of 
tickets with specified ticket numbers (for old tickets. The numbers 
would be WAY lower than currently used). The RT Essentials book mentions 
the ability to create/edit/show a ticket, but no specifics on how to 
create a whole bunch using a file or what delimiters those records in 
that file would need, etc. Does anyone know how to do this? Thanks in 
advance.


Kenn
LBNL

___
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] CLI Question - Add Users to group per Scrip

2007-03-01 Thread Torsten Brumm | Kuehne + Nagel
Hi Joe,

Thanks, it works very well, you saved my many hours of work!!! I owe you a
beer!

Torsten


On 28.02.2007 14:53 Uhr, "Joe Casadonte" <[EMAIL PROTECTED]> wrote:

> On 2/27/2007 7:15 AM, Torsten Brumm wrote:
> 
>> And line 38 looks like:
>> 
>> my($status, $msg) = $group->{$groupname}->AddMember($user->id);
>> I'm not sure if the AddMember is defined in this routine, but i found:
> 
> Cut and paste error on my part.  I think that line should read:
> 
> my($status, $msg) = $group->AddMember($user->id);


-- 
With kindest regards

KÜHNE+NAGEL (AG & Co.) KG
Torsten Brumm / HAM MI-ID
Datacenter Hamburg
Bauerbergweg 25
22111 Hamburg

Tel: +49 40 3033 33 199
Fax: +49 40 3033 344 3199
Gsm: +49 40 176 27 27 18 50
Mail: [EMAIL PROTECTED]
Web: www.kuehne-nagel.com

Kühne + Nagel (AG & Co.) KG,
Geschäftsleitung: Hans-Georg Brinkmann (Vors.), Uwe Bielang (Stellv.), Dr.
Björn Johansson (Stellv.), Bruno Mang, Alfred Manke, Thorsten Meincke, Mark
Reinhardt (Stellv.), Tim Scharwath, Jens Wollensen

Sitz: Bremen, Registergericht: Bremen, HRA 21928, USt-IdNr.: DE 812773878,

Persönlich haftende Gesellschaft: Kühne & Nagel A.G., Sitz:
Contern/LuxemburgGeschäftsführender Verwaltungsrat: Klaus-Michael Kühne

___
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] CLI Question - Add Users to group per Scrip

2007-02-28 Thread Joe Casadonte

On 2/27/2007 7:15 AM, Torsten Brumm wrote:


And line 38 looks like:

my($status, $msg) = $group->{$groupname}->AddMember($user->id);
I'm not sure if the AddMember is defined in this routine, but i found:


Cut and paste error on my part.  I think that line should read:

my($status, $msg) = $group->AddMember($user->id);

--
Regards,


joe
Joe Casadonte
[EMAIL PROTECTED]

==  ==
== The statements and opinions expressed here are my own and do not ==
== necessarily represent those of Oracle Corporation.   ==
==  ==
___
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] CLI Question - Add Users to group per Scrip

2007-02-27 Thread Torsten Brumm

Hi Joe,

your scrip looks fine so far, but i get a strange error message:

[Tue Feb 27 12:29:07 2007] [crit]: Can't call method "AddMember" on an
undefined value at AddUsersToGroups.pl line 38. (/opt/rt36/lib/RT.pm:346)
Can't call method "AddMember" on an undefined value at
AddUsersToGroups.plline 38.

And line 38 looks like:

my($status, $msg) = $group->{$groupname}->AddMember($user->id);
I'm not sure if the AddMember is defined in this routine, but i found:
SetMemberId 
VALUE

Have you tried it?

Torsten
2007/2/15, Joe Casadonte <[EMAIL PROTECTED]>:


On 2/15/2007 11:04 AM, Torsten Brumm | Kuehne + Nagel wrote:

> Again just another question for the CLI Part. Has anyone a idea how to
add a
> set of users per scrip to a group?
>
> Lets say, i have a list of 500 User that are needed to be member of a
single
> group?

I did something similar via a full perl script (as opposed to using the
CLI).  Here are some excerpts (untested in this form):

#!/usr/bin/perl -w

use strict;
use lib "/opt/rt3/lib";

use RT;
use RT::Interface::CLI qw(CleanEnv GetCurrentUser);
use RT::Group;
use RT::User;

CleanEnv();
RT::LoadConfig();
RT::Init();

my($groupname) = 'FooBar';
my($group) = RT::Group->new($RT::SystemUser);
$group->LoadUserDefinedGroup($groupname);
die qq([ERROR] Cannot load group "$groupname"\n) unless $group->id;

my(@users) = GetListOfUsernames();
foreach my $username (@users) {
my($user) = RT::User->new($RT::SystemUser);
$user->Load($username);
die qq([ERROR] Could not load user "$username" -- see log for
details\n) unless $user->id;

my($status, $msg) = $Groups->{$groupname}->AddMember($user->id);
die qq([ERROR] Cannot add user "$id" to group "$groupname" - $msg\n)
unless $status;
}

--
Regards,


joe
Joe Casadonte
[EMAIL PROTECTED]

==  ==
== The statements and opinions expressed here are my own and do not ==
== necessarily represent those of Oracle Corporation.   ==
==  ==
___
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





--
MFG

Torsten Brumm

http://www.torsten-brumm.de
___
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] CLI Question - Add Users to group per Scrip

2007-02-16 Thread Joe Casadonte

On 2/16/2007 2:11 AM, Torsten Brumm wrote:


my(@users) = GetListOfUsernames();

Do you get with this a list from RT Users Table ?


Well, for me I was reading the names out of an Excel file, creating the 
users first, and then adding them to a bunch of different groups.  I 
guess what I'm saying is that the implementation of GetListOfUsernames() 
is left as an exercise for the reader   :)


--
Regards,


joe
Joe Casadonte
[EMAIL PROTECTED]

==  ==
== The statements and opinions expressed here are my own and do not ==
== necessarily represent those of Oracle Corporation.   ==
==  ==
___
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] CLI Question - Add Users to group per Scrip

2007-02-15 Thread Torsten Brumm

Hi Joe,

thats exactly what i'm looking for.

Just a small question to this scrip:

my(@users) = GetListOfUsernames();

Do you get with this a list from RT Users Table ?

Thanks

Torsten

2007/2/15, Joe Casadonte <[EMAIL PROTECTED]>:


On 2/15/2007 11:04 AM, Torsten Brumm | Kuehne + Nagel wrote:

> Again just another question for the CLI Part. Has anyone a idea how to
add a
> set of users per scrip to a group?
>
> Lets say, i have a list of 500 User that are needed to be member of a
single
> group?

I did something similar via a full perl script (as opposed to using the
CLI).  Here are some excerpts (untested in this form):

#!/usr/bin/perl -w

use strict;
use lib "/opt/rt3/lib";

use RT;
use RT::Interface::CLI qw(CleanEnv GetCurrentUser);
use RT::Group;
use RT::User;

CleanEnv();
RT::LoadConfig();
RT::Init();

my($groupname) = 'FooBar';
my($group) = RT::Group->new($RT::SystemUser);
$group->LoadUserDefinedGroup($groupname);
die qq([ERROR] Cannot load group "$groupname"\n) unless $group->id;

my(@users) = GetListOfUsernames();
foreach my $username (@users) {
my($user) = RT::User->new($RT::SystemUser);
$user->Load($username);
die qq([ERROR] Could not load user "$username" -- see log for
details\n) unless $user->id;

my($status, $msg) = $Groups->{$groupname}->AddMember($user->id);
die qq([ERROR] Cannot add user "$id" to group "$groupname" - $msg\n)
unless $status;
}

--
Regards,


joe
Joe Casadonte
[EMAIL PROTECTED]

==  ==
== The statements and opinions expressed here are my own and do not ==
== necessarily represent those of Oracle Corporation.   ==
==  ==
___
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





--
MFG

Torsten Brumm

http://www.torsten-brumm.de
___
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] CLI Question - Add Users to group per Scrip

2007-02-15 Thread Joe Casadonte

On 2/15/2007 11:04 AM, Torsten Brumm | Kuehne + Nagel wrote:


Again just another question for the CLI Part. Has anyone a idea how to add a
set of users per scrip to a group?

Lets say, i have a list of 500 User that are needed to be member of a single
group?


I did something similar via a full perl script (as opposed to using the 
CLI).  Here are some excerpts (untested in this form):


#!/usr/bin/perl -w

use strict;
use lib "/opt/rt3/lib";

use RT;
use RT::Interface::CLI qw(CleanEnv GetCurrentUser);
use RT::Group;
use RT::User;

CleanEnv();
RT::LoadConfig();
RT::Init();

my($groupname) = 'FooBar';
my($group) = RT::Group->new($RT::SystemUser);
$group->LoadUserDefinedGroup($groupname);
die qq([ERROR] Cannot load group "$groupname"\n) unless $group->id;

my(@users) = GetListOfUsernames();
foreach my $username (@users) {
   my($user) = RT::User->new($RT::SystemUser);
   $user->Load($username);
   die qq([ERROR] Could not load user "$username" -- see log for 
details\n) unless $user->id;


   my($status, $msg) = $Groups->{$groupname}->AddMember($user->id);
   die qq([ERROR] Cannot add user "$id" to group "$groupname" - $msg\n) 
unless $status;

}

--
Regards,


joe
Joe Casadonte
[EMAIL PROTECTED]

==  ==
== The statements and opinions expressed here are my own and do not ==
== necessarily represent those of Oracle Corporation.   ==
==  ==
___
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] CLI Question - Add Users to group per Scrip

2007-02-15 Thread Bob Goldstein
>Hi,
>
>Again just another question for the CLI Part. Has anyone a idea how to add a
>set of users per scrip to a group?
>
>Lets say, i have a list of 500 User that are needed to be member of a single
>group?

  This isn't a direct answer, but several months ago I was wrestling with
  a similar issue of users and groups.  Although I'm sure I could hammer
  in some code to do this, after reading through the REST code, I started
  thinking about what would be involved in a REST2 interface, something
  that would provide more structure for extensions or modifications
  on the server end.

  I haven't coded anything yet, but I did write up some notes
  on what a new wire protocol and code organization might be like.

 http://tigger.uic.edu/~bobg/rt_api.html

  Comments are welcome.  I'm mostly convinced, but not 100%
  sure this is a good way to go.  And probably my notes
  would change if/when I start building this.

 bobg
___
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] CLI Question - Add Users to group per Scrip

2007-02-15 Thread Torsten Brumm | Kuehne + Nagel
Hi,

Again just another question for the CLI Part. Has anyone a idea how to add a
set of users per scrip to a group?

Lets say, i have a list of 500 User that are needed to be member of a single
group?
-- 
With kindest regards

Torsten Brumm
Kuehne + Nagel 
Datacenter Hamburg
Bauerbergweg 25
22111 Hamburg

Tel: +49 40 3033 33 199
Fax: +49 40 3033 344 3199
Gsm: +49 40 176 27 27 18 50
Mail: [EMAIL PROTECTED]
Web: www.kuehne-nagel.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


Re: [rt-users] CLI Question: Set dependson value via CLI?

2006-08-22 Thread Joshua Colson
On Tue, 2006-08-22 at 07:58 -0400, Jim Brandt wrote:
> I've searched and played around with the CLI interface but I can't find 
> a way to set or modify items in the 'Links' section, specifically 
> depends on or is depended on by.

This seems to be an undocumented feature:

rt link  DependsOn 

(or try 'rt help link')

HTH

-- 
Joshua Colson <[EMAIL PROTECTED]>

___
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] CLI Question: Set dependson value via CLI?

2006-08-22 Thread Jim Brandt


I've searched and played around with the CLI interface but I can't find 
a way to set or modify items in the 'Links' section, specifically 
depends on or is depended on by.


Am I just missing something?

I'm attempting to script some actions against RT and my next step to add 
the "depends on" part is to go through the interface with WWW::Mech. I 
was able to get the rest of my script working via the CLI and I really 
wanted to do all of the work there.


Thanks,
Jim


--
Jim Brandt
Administrative Computing Services
University at Buffalo


___
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