#!/usr/bin/perl
#
# create_ticket.pl -- create an RT ticket.
use
strict;
use
warnings;
use
RT::Client::REST;
unless
(
@ARGV
>= 3 ) {
die
"Usage: $0 username password queue subject\n"
;
}
my
$rt
=
);
$rt
->login(
username
=>
shift
(
@ARGV
),
password
=>
shift
(
@ARGV
),
);
"Please enter the text of the ticket:\n"
;
my
$text
=
join
(
''
, <STDIN> );
my
$ticket
= RT::Client::REST::Ticket->new(
rt
=>
$rt
,
queue
=>
shift
(
@ARGV
),
subject
=>
shift
(
@ARGV
),
)->store(
text
=>
$text
);
use
Data::Dumper;
Dumper(
$ticket
);