Correct tax ticket processing.
This commit is contained in:
parent
2598a6f739
commit
f00819a174
1 changed files with 6 additions and 2 deletions
|
@ -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: ",
|
||||
|
|
Loading…
Reference in a new issue