Talk:ImportCustomFieldValues/@comment-Missbook-20121130205417: Difference between revisions

From Request Tracker Wiki
Jump to navigation Jump to search
m (1 revision imported)
 
(No difference)

Latest revision as of 15:52, 6 April 2016

Thank you!  This worked nicely for me!  I changed it for CustomFields with a Category (though I am not the best at perl)

Adding variables at the top:

my @newValue;
my $entry;
my $cat;

And a new foreach loop:

foreach my $line (@lines) {
@newValue = split(/,/, $line);
$entry = $newValue[1];
$cat = $newValue[0];
unless ( grep { $entry eq $_ } @current ) {
print STDERR "Adding " . $entry . " with category " . $cat . "\n" if ($args{'verbose'});
my ( $ret, $val ) = $cf->AddValue( Name => $entry, Category => $cat );
}
}