use Types::Standard -all;
use Type::Utils;
-my $EmptyStr = declare "EmptyStr",
- as Str,
- where { length($_) == 0 },
- inline_as { $_[0]->parent->inline_check($_) . " && length($_) == 0" },
- message { "String is not empty" };
-
my $SearchResult = Dict[
id => Int,
type => Str,
repositoryPHID => Maybe[Str],
status => HashRef,
summary => Str,
- "bugzilla.bug-id" => Int | $EmptyStr,
+ "bugzilla.bug-id" => Str
],
attachments => Dict[
reviewers => Dict[
$result = $result->{result}->{data}->[0];
}
+ # Some values in Phabricator for bug ids may have been saved
+ # white whitespace so we remove any here just in case.
+ $result->{fields}->{'bugzilla.bug-id'} = trim($result->{fields}->{'bugzilla.bug-id'});
+
return $result;
}