Correct rt show output; add verbosity there.

Note that "rt show ticket/NUMBER" does not give the entire ticket traffic,
whereas "rt show NUMBER" does.
This commit is contained in:
Bradley M. Kuhn 2018-07-25 09:44:19 -07:00
parent c1fdf916d9
commit 2e8f9c42d1

View file

@ -28,9 +28,10 @@ sub TicketIDsReadyForPayment () {
sub FindMostRecentPaymentMethodForTicket ($) {
my($ticketSpec) = @_;
my $paymentMethod;
open(my $rtShowFH, "-|", "$RT_CMD", "ls", "-i", "Status = 'ready-for-payment'");
$ticketSpec =~ s%^\s*ticket\s*/\s*%%;
open(my $rtShowFH, "-|", "$RT_CMD", "show", $ticketSpec);
while (my $showLine = <$rtShowFH>) {
print STDERR "rt show line for $ticketSpec: $showLine" if ($VERBOSE >= 10);
$paymentMethod = $1
if ($showLine =~ /\s+PAYMENT\s+METHOD\s*:\s*(.*?)\s*$/);
# don't 'last' when found as we want the last one.