Commit e1fbb34a authored by Daniel Kahn Gillmor's avatar Daniel Kahn Gillmor Committed by Alex Vandiver
Browse files

Allow the rt client to modify the status of a ticket while commenting

A reasonable use case for rt is to comment on a ticket (or
"correspond", which is just a comment that is also sent to the ticket
requestor).  In the web form for commenting, there is the ability to
update the status of the ticket at the same time.

This feature should be exposed in the command line client as well.

Bug-Debian: http://bugs.debian.org/760292
parent d41e6a6a
......@@ -792,6 +792,7 @@ sub comment {
my ($action) = @_;
my (%data, $id, @files, @bcc, @cc, $msg, $content_type, $wtime, $edit);
my $bad = 0;
my $status = '';
while (@ARGV) {
$_ = shift @ARGV;
......@@ -799,7 +800,7 @@ sub comment {
if (/^-e$/) {
$edit = 1;
}
elsif (/^-(?:[abcmw]|ct)$/) {
elsif (/^-(?:[abcmws]|ct)$/) {
unless (@ARGV) {
whine "No argument specified with $_.";
$bad = 1; last;
......@@ -815,6 +816,9 @@ sub comment {
elsif (/-ct/) {
$content_type = shift @ARGV;
}
elsif (/-s/) {
$status = shift @ARGV;
}
elsif (/-([bc])/) {
my $a = $_ eq "-b" ? \@bcc : \@cc;
@$a = split /\s*,\s*/, shift @ARGV;
......@@ -857,9 +861,12 @@ sub comment {
TimeWorked => $wtime || '',
'Content-Type' => $content_type || 'text/plain',
Text => $msg || '',
Status => ''
Status => $status
}
];
if ($status ne '') {
push(@{$form->[1]}, "Status");
}
my $text = Form::compose([ $form ]);
......@@ -2402,6 +2409,8 @@ Text:
than once to attach multiple files.)
-c <addrs> A comma-separated list of Cc addresses.
-b <addrs> A comma-separated list of Bcc addresses.
-s <status> Set a new status for the ticket (default will
leave the status unchanged)
-w <time> Specify the time spent working on this ticket.
-e Starts an editor before the submission, even if
arguments from the command line were sufficient.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment