commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Phil Steitz" <phil.ste...@gmail.com>
Subject Re: [all] Maven changes plugin and Bugzilla -> Jira migration
Date Mon, 05 Jun 2006 15:16:23 GMT
OK, went ahead and scripted this.  Here's what I did after setting
maven.changes.issue.template=http://issues.apache.org/jira/browse/%ISSUE%

No laughing at my Perl ....

Phil
------------------------

#
# Script to replace Bugzilla IDs with JIRA.
# $file needs to be csv with jira ID first, then BZ.
# Use "all" issue view from JIRA issue browser and download to spreadsheet, then
# delete other cols and export to csv.
#

# read CSV file exported from JIRA into hash
$file = 'issueMap.csv';
$changes = 'changes.xml';
open (F, $file) || die ("Could not open $file!");
while ($line = <F>)
{
  $line =~ s/[\"\n\ ]//g; # lose the quotes, newlines, spaces
  ($jira,$bugzilla) = split ',', $line;
  $issues{$bugzilla} = $jira;
}
close (F);

# make replacements one at a time (ugly, but simple and works)
while (($bugzilla, $jira) = each(%issues))
{
  `cat $changes |sed "s/$bugzilla/$jira/g" > $changes.new`;
  `mv $changes.new $changes`;
  print "jira: $jira <- bugzilla: $bugzilla \n";
}

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org


Mime
View raw message