New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When creating a Ticket or Asset, about CustomFields to use names. #14

Open
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
2 participants
@puck
Copy link

puck commented Oct 15, 2018

The docs all show examples of specifying CustomFields by name, yet that
doesn't actually work. Let's make it work.

Andrew Ruthven
When creating a Ticket or Asset, about CustomFields to use names.
The docs all show examples of specifying CustomFields by name, yet that
doesn't actually work. Let's make it work.
if ($id !~ /^\d+$/) {
my $cf = $record->LoadCustomFieldByIdentifier($id);
$id = $cf->Id;
}
delete $cfs->{$id};

This comment has been minimized.

@gibus

gibus Oct 21, 2018

Actually the if-condition you've added should lie after this delete line, since $id is modified in the if-condition, $cfs->{$id} is undef and initital $cfs->{<Name of CF>} is not deleted. This triggers no warnings, since RT::Ticket::Create() will silently ignore it (doing a next unless $arg =~ /^CustomField-(\d+)$/i; when parsing CFs arguments). Nevertheless, if RT::Ticket::Create() is changed one of these days to trigger a warning when parsing malformed CFs arguments, tests based on your pull request will fail.

This comment has been minimized.

@puck

puck Oct 22, 2018

Good catch. I'll update the PR during the week.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment