Package: rt4-clients
Version: 4.2.4-1
Severity: wishlist
Tags: upstream patch
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.
The attached patch enables this functionality for me.
--dkg
-- System Information:
Debian Release: jessie/sid
APT prefers testing
APT policy: (500, 'testing'), (200, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386
Kernel: Linux 3.14-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Versions of packages rt4-clients depends on:
ii libterm-readkey-perl 2.32-1+b1
ii libterm-readline-perl-perl 1.0303-1
ii libwww-perl 6.08-1
ii perl 5.20.0-4
ii postfix [mail-transport-agent] 2.11.1-1
Versions of packages rt4-clients recommends:
ii libio-socket-ssl-perl 1.997-2
rt4-clients suggests no packages.
-- debconf-show failed
diff --git a/bin/rt b/bin/rt
index d342b64..3804cf7 100755
--- a/bin/rt
+++ b/bin/rt
@@ -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.