CLI - Line Breaks for body

Hi, I need to use the CLI to create tickets, however I’m having
issues submitting line breaks in the body. How do you indicate a line
break to RT through the CLI. I’m using the script in this example:
http://wiki.bestpractical.com/index.cgi?CliBasics

Thanks,
Cj B

Hi Cj,

We were unable to get the text attribute of ‘rt create -t ticket’ to accept newlines on the CLI. The -m flag to ‘rt comment’ accepts them, though. We used this 2-step process to create our tickets with existing data.

Sincerely,
Frank Pater
DCANet

voice: 888-4-DCANET (888-432-2638)
fax: 302-426-6386On Thu, Sep 14, 2006 at 12:50:49PM -0700, Chris Black wrote:

Hi, I need to use the CLI to create tickets, however I’m having
issues submitting line breaks in the body. How do you indicate a line
break to RT through the CLI. I’m using the script in this example:
Request Tracker Wiki

Thanks,
Cj B


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Hi, I haven’t attempted to use this CLI command before, but when I
try now I get:

[root@felwood rt]$ ./bin/rt comment -m “this is a test\n test” 5242
Password:
rt: Server error: Not Found (404)

Any ideas on that?

I currently do it using this script:
#!/usr/bin/perl -w

use lib “/usr/local/rt/lib”;
use lib “/usr/local/rt/etc”;

use RT::Interface::CLI;
use RT;
RT::LoadConfig();
RT::Init();
use RT::Ticket;
use RT::CurrentUser;
my $CurrentUser = RT::Interface::CLI::GetCurrentUser();

use MIME::Entity;

     $queue = $ARGV[0];
     $requestor = $ARGV[1];
     $subject = $ARGV[2];
     $body = $ARGV[3];
     $client = $ARGV[4];
     $contact = $ARGV[5];
     $impact = $ARGV[6];
     $phi = $ARGV[7];
     $source = $ARGV[8];
     $category = $ARGV[9];
     $severity = $ARGV[10];
     my $ticket = new RT::Ticket($CurrentUser);
     my $ticket_body = MIME::Entity->build(Data => $body,
             Type => 'text/plain');

     my %ticket_vals = ( Queue => $queue,
             Subject => $subject,
             Owner => '',
             Requestor => $requestor,
             InitialPriority => '11',
             FinalPriority => '20',
             MIMEObj => $ticket_body,
             'CustomField-2' => $client,
             'CustomField-14' => $contact,
             'CustomField-21' => $impact,
             'CustomField-10' => $phi,
             'CustomField-26' => $source,
             'CustomField-20' => $category,
            'CustomField-15' => $severity,
     );
     my ($id, $transaction_object, $err) = $ticket->Create(% 

ticket_vals);
print STDERR $err . “\n” if $err;

Thanks,
Cj BOn Sep 14, 2006, at 1:12 PM, Frank Pater wrote:

Hi Cj,

We were unable to get the text attribute of ‘rt create -t ticket’
to accept newlines on the CLI. The -m flag to ‘rt comment’ accepts
them, though. We used this 2-step process to create our tickets
with existing data.

Sincerely,
Frank Pater
DCANet
http://www.dca.net
voice: 888-4-DCANET (888-432-2638)
fax: 302-426-6386

On Thu, Sep 14, 2006 at 12:50:49PM -0700, Chris Black wrote:

Hi, I need to use the CLI to create tickets, however I’m having
issues submitting line breaks in the body. How do you indicate a line
break to RT through the CLI. I’m using the script in this example:
Request Tracker Wiki

Thanks,
Cj B


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

Hi guys, we pass the testing face for our RT install with ldap, so I was
going to put it under the real domain.
so for this I did all the right changes and sed awk etc from the right
places also…
now it comes up but I can only log in as root… everything is just fine
and perfect till I try to log in as a user…
and reason is cause all of the sudem the ldap is not working:

[critical]: RT::User::_GetBoundLdapObj : Cannot connect to

(//var/www/support.lan.voicesignal.com/rt-3.6.1/local/lib/RT/User_Local.pm:438)
[Thu Sep 14 20:27:06 2006] [critical]: RT::User::_GetBoundLdapObj :
Cannot connect to ldap.lan.voicesignal.com
(//var/www/support.lan.voicesignal.com/rt-3.6.1/local/lib/RT/User_Local.pm:438)
[Thu Sep 14 20:27:06 2006] [critical]: RT::User::_GetBoundLdapObj :
Cannot connect to ldap.lan.voicesignal.com
(//var/www/support.lan.voicesignal.com/rt-3.6.1/local/lib/RT/User_Local.pm:438)
[Thu Sep 14 20:27:06 2006] [critical]: RT::User::_GetBoundLdapObj :
Cannot connect to ldap.lan.voicesignal.com
(//var/www/support.lan.voicesignal.com/rt-3.6.1/local/lib/RT/User_Local.pm:438)
[Thu Sep 14 20:27:06 2006] [critical]: RT::User::_GetBoundLdapObj :
Cannot connect to ldap.lan.voicesignal.com
(//var/www/support.lan.voicesignal.com/rt-3.6.1/local/lib/RT/User_Local.pm:438)
[Thu Sep 14 20:27:06 2006] [critical]: RT::User::_GetBoundLdapObj :
Cannot connect to ldap.lan.voicesignal.com
(//var/www/support.lan.voicesignal.com/rt-3.6.1/local/lib/RT/User_Local.pm:438)
[Thu Sep 14 20:27:06 2006] [critical]: RT::User::_GetBoundLdapObj :
Cannot connect to ldap.lan.voicesignal.com
(//var/www/support.lan.voicesignal.com/rt-3.6.1/local/lib/RT/User_Local.pm:438)
[Thu Sep 14 20:27:06 2006] [critical]: RT::User::_GetBoundLdapObj :
Cannot connect to ldap.lan.voicesignal.com
(//var/www/support.lan.voicesignal.com/rt-3.6.1/local/lib/RT/User_Local.pm:438)
[

Frank Pater wrote:

cfernandez.vcf (572 Bytes)

Hi,

Hi, I haven’t attempted to use this CLI command before, but when I
try now I get:

[root@felwood rt]$ ./bin/rt comment -m “this is a test\n test” 5242
Password:
rt: Server error: Not Found (404)

Any ideas on that?

Near the top of ./bin/rt there is a hash, %config. Try setting ‘server’ in this hash to the URL of your RT WebUI (it defaults to http://localhost/rt/ so if you can’t access the WebUI via lynx from the server command-line, then this is probably why the CLI tool is failing). As for the code below, I’m still working through something similar, and I’m afraid I can’t help much with that. At a minimum, you should be able to execute

./bin/rt create -t ticket

and successfully create a ticket. After that, the comment syntax should work as well.

Sincerely,
Frank Pater
DCANet

voice: 888-4-DCANET (888-432-2638)
fax: 302-426-6386