Talk:ImportCustomFieldValues/@comment-Missbook-20121130205417

From Request Tracker Wiki
Revision as of 15:52, 6 April 2016 by Admin (talk | contribs) (1 revision imported)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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 );
}
}