diff --git a/scripts/rt-bulk-prep-pay.plx b/scripts/rt-bulk-prep-pay.plx index 959c005..84eeb88 100755 --- a/scripts/rt-bulk-prep-pay.plx +++ b/scripts/rt-bulk-prep-pay.plx @@ -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.