Additional issues with CF matching.

This commit is contained in:
Bradley M. Kuhn 2018-07-22 15:21:59 -07:00
parent 54cd914e47
commit 2598a6f739

View file

@ -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;
}
###############################################################################