X-Git-Url: https://defaria.com/gitweb/?a=blobdiff_plain;f=JIRA%2FimportComments.pl;h=ed6447c69bdda59fd4b05b554e75d134f59ca9d0;hb=7ddf095f187ca60d9a70fb83b2bc3c2b6d91f088;hp=6a1712c6e4486ca641de473eb04a3c696172b18a;hpb=8b59f0654d6cedeb6564480ee69acdcf0988e9ff;p=clearscm.git diff --git a/JIRA/importComments.pl b/JIRA/importComments.pl old mode 100644 new mode 100755 index 6a1712c..ed6447c --- a/JIRA/importComments.pl +++ b/JIRA/importComments.pl @@ -94,7 +94,7 @@ our ($log, %total); sub sanitize ($) { my ($str) = @_; - + my $p4web = 'http://p4web.audience.local:8080/@md=d&cd=//&c=vLW@/'; my $bugzilla = 'http://bugs.audience.com/show_bug.cgi?id='; @@ -159,7 +159,7 @@ sub addComments ($$) { sub main () { my $startTime = time; - + GetOptions ( \%opts, 'verbose', @@ -182,24 +182,24 @@ sub main () { if ($opts{file}) { open my $file, '<', $opts{file} or $log->err ("Unable to open $opts{file} - $!", 1); - + $opts{bugids} = [<$file>]; - + chomp @{$opts{bugids}}; } else { my @bugids; - + push @bugids, (split /,/, join (',', $_)) for (@{$opts{bugids}}); - + $opts{bugids} = [@bugids]; } # if - + pod2usage 'Must specify -bugids [,,...] or -file ' unless $opts{bugids}; - + openBugzilla $opts{bugzillaserver} or $log->err ("Unable to connect to $opts{bugzillaserver}", 1); - + Connect2JIRA ($opts{username}, $opts{password}, $opts{jiraserver}) or $log->err ("Unable to connect to $opts{jiraserver}", 1); @@ -207,10 +207,10 @@ sub main () { for (@{$opts{bugids}}) { my $jiraIssue = findIssue $_; - + if ($jiraIssue =~ /^[A-Z]{1,5}-\d+$/) { my $result = addComments $jiraIssue, $_; - + if ($result =~ /^Unable/) { $total{'Comment failures'}++; @@ -222,13 +222,13 @@ sub main () { } # if } else { $total{'Missing JIRA Issues'}++; - + $log->err ("Unable to find JIRA Issue for Bug $_"); } # if } # for display_duration $startTime, $log; - + Stats (\%total, $log) unless $opts{quiet}; return 0;