From 2598a6f7394d9a1f2f787ae0dba1d019daa0428b Mon Sep 17 00:00:00 2001 From: "Bradley M. Kuhn" Date: Sun, 22 Jul 2018 15:21:59 -0700 Subject: [PATCH] Additional issues with CF matching. --- scripts/rt-outreachy-payment-next.plx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/scripts/rt-outreachy-payment-next.plx b/scripts/rt-outreachy-payment-next.plx index 96fd6e4..250ef48 100755 --- a/scripts/rt-outreachy-payment-next.plx +++ b/scripts/rt-outreachy-payment-next.plx @@ -39,7 +39,7 @@ sub PaymentDateByTicket($$) { my $date; while (my $payLine = <$rtPayFH>) { chomp $payLine; - if ($payLine =~ /[\d\-]+/) { + if ($payLine =~ /^\s*CF\s*.\s*{payment-$paymentNumber-sent}\s*:\s*[\d\-]+\s*$/) { $date = $payLine; last; } @@ -112,16 +112,16 @@ sub GetStatusFromTicket($) { ############################################################################### sub GetCustomFieldForTicket($$) { my($ticketSpec, $customField) = @_; - open(my $rtPayFH, "-|", "$RT_CMD", "show", "-f", 'CF.{' . $customField .'}', $ticketSpec); + open(my $rtCustomFH, "-|", "$RT_CMD", "show", "-f", 'CF.{' . $customField .'}', $ticketSpec); my $val; - while (my $customFieldLine = <$rtPayFH>) { + while (my $customFieldLine = <$rtCustomFH>) { chomp $customFieldLine; - if ($customFieldLine =~ /^\s*(\S+)\s*$/) { - $val = $customFieldLine; + if ($customFieldLine =~ /^\s*CF\s*.\s*{$customField}\s*:\s*(\S+)\s*$/) { + $val = $1; last; } } - close $rtPayFH; + close $rtCustomFH; return $val; } ###############################################################################