diff --git a/scripts/rt-outreachy-payment-next.plx b/scripts/rt-outreachy-payment-next.plx index 250ef48..599096e 100755 --- a/scripts/rt-outreachy-payment-next.plx +++ b/scripts/rt-outreachy-payment-next.plx @@ -70,7 +70,7 @@ sub GetLinksForTicket($) { my @linked; open(my $rtLinksFH, "-|", "$RT_CMD", "show", $ticketSpec . '/links'); while (my $linksLine = <$rtLinksFH>) { - if ($linksLine =~ m%rt.*ticket/(\d+)\s*$%) { + if ($linksLine =~ m%rt.*(ticket/\d+)\s*,?\s*$%) { push(@linked, $1); } } @@ -92,7 +92,6 @@ sub FindTaxTicketFromList(@) { close $rtQueueFH; last if defined $taxTicket; } - $taxTicket = "ticket/$taxTicket" if defined $taxTicket; return $taxTicket; } ############################################################################### @@ -236,10 +235,15 @@ while (my $file = readdir $dh) { } my(@links) = GetLinksForTicket($ticket); + if ($VERBOSE > 5) { + print STDERR "\"$file\": \"$ticket\": Found the following links: " , join( ", ", @links), "\n"; + } my $taxTicket = FindTaxTicketFromList(@links); if (not defined $taxTicket) { print STDERR "\"$file\": \"$ticket\": Skipped: no tax ticket found.\n"; + next; } + print STDERR "\"$file\": \"$ticket\": found a tax ticket of \"$taxTicket\"\n" if ($VERBOSE > 5); my $taxTicketStatus = GetStatusFromTicket($taxTicket); if ($taxTicketStatus ne "resolved") { print STDERR "\"$file\": \"$ticket\": Tax Ticket: \"$taxTicket\": Skipped: ",