[Rt-commit] rt branch, 4.2-trunk, updated. rt-4.2.6-106-ge1fbb34

Alex Vandiver alexmv at bestpractical.com
Wed Sep 3 19:48:51 EDT 2014


The branch, 4.2-trunk has been updated
       via  e1fbb34a2216fa19639adb49cacd02be4f902065 (commit)
      from  d41e6a6a9e706f90f469d9a2d9ca716aa945464c (commit)

Summary of changes:
 bin/rt.in | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

- Log -----------------------------------------------------------------
commit e1fbb34a2216fa19639adb49cacd02be4f902065
Author: Daniel Kahn Gillmor <dkg at fifthhorseman.net>
Date:   Thu Sep 4 00:18:43 2014 +0100

    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

diff --git a/bin/rt.in b/bin/rt.in
index 22b38df..1de9bdd 100644
--- a/bin/rt.in
+++ b/bin/rt.in
@@ -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.

-----------------------------------------------------------------------


More information about the rt-commit mailing list