CLI question

Hi All

I am using RT 3.2.2. I have been using CLI for general stuff like
changing status, resolving mass tickets etc. But one thing this tool
seems lacking–at least by default–not shows the content of a ticket

For example I run

rt show ticket/23547

and It shows the value of all the attributes like

id: ticket/206983
Queue: SysHelp
Owner: Asif
Creator: Joe
Status: open
Priority: 33
InitialPriority: 30
FinalPriority: 90
Requestors: test.user@here.com
Cc:
AdminCc:
Created: Fri Feb 06 17:34:19 2004
Starts: Not set
Started: Tue Oct 19 10:12:11 2004
Due: Not set
Resolved: Not set
Told: Not set
TimeEstimated: 0
TimeWorked: 0
TimeLeft: 0

Is there a way I can see the content of the ticket, and all
transactions?

Thanks for any tip

Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
“…it said: Install Windows XP or better…so I installed Solaris…”

Is there a way I can see the content of the ticket, and all
transactions?

No, but it’s not that hard.

rt show ticket/23547/history

This will reveal the transactions in the ticket and then you can
select a transaction to view.

rt show ticket/23547/history/id/12345

Use the appropriate transaction id.

Andy Harrison

While we’re asking CLI questions; Is there a way to set custom fields when
creating a ticket via the CLI tool?

I couldn’t even figure out how to get it show the custom fields, let
alone set them.

Andy Harrison

While we’re asking CLI questions; Is there a way to set custom fields when
creating a ticket via the CLI tool?

Thanks,

Ryan Roland

Application Developer
Information Technology
Division of Recreational Sports
Indiana University

812.855.9617
rmroland@indiana.eduFrom: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Andy Harrison
Sent: Friday, December 17, 2004 06:40
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] CLI question

Is there a way I can see the content of the ticket, and all
transactions?

No, but it’s not that hard.

rt show ticket/23547/history

This will reveal the transactions in the ticket and then you can
select a transaction to view.

rt show ticket/23547/history/id/12345

Use the appropriate transaction id.

Andy Harrison
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Be sure to check out the RT wiki at http://wiki.bestpractical.com

smime.p7s (2.96 KB)

rt list shows ticket number and subject. Is there a way I can also
display the Owner? I know I can just select owner=XXXX, but I still
wanted to find a way to show Owner in the list output

Thanks for hints/tipsOn Fri, Dec 17, 2004 at 06:40:08AM, Andy Harrison wrote:

On Fri, 17 Dec 2004 03:17:53 -0500, Asif Iqbal iqbala-rt-users@qwestip.net wrote:

Is there a way I can see the content of the ticket, and all
transactions?

No, but it’s not that hard.

rt show ticket/23547/history

This will reveal the transactions in the ticket and then you can
select a transaction to view.

rt show ticket/23547/history/id/12345

Use the appropriate transaction id.


Andy Harrison


The rt-users Archives

Be sure to check out the RT wiki at http://wiki.bestpractical.com

Asif Iqbal
PGP Key: 0xE62693C5 KeyServer: pgp.mit.edu
“…it said: Install Windows XP or better…so I installed Solaris…”

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

Hi ;

Using rt-3.6.3

Is there a bug in using:
./rt edit ticket/$tid add cc="abc@efg.com"
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

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 Queue Age 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

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.000000000 +0200
+++ rt 2013-09-09 16:06:20.000000000 +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.

NathanOn Thu, Sep 5, 2013 at 4:40 PM, Nathan Cutler presnypreklad@gmail.com 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 Queue Age 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

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 presnypreklad@gmail.comwrote:

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.000000000 +0200
+++ rt 2013-09-09 16:06:20.000000000 +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 presnypreklad@gmail.com 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 Queue Age 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.