diff options
author | Dave Lawrence <dlawrence@mozilla.com> | 2012-04-13 01:49:37 -0400 |
---|---|---|
committer | Dave Lawrence <dlawrence@mozilla.com> | 2012-04-13 01:49:37 -0400 |
commit | 9eeb23d40782f3d62cf61e988ea0a2eca7d291a7 (patch) | |
tree | 842af69b99da7ee71c0a1624b0cbd5751bf7d97d | |
parent | a699a59ef4fd7bab94d6256a586b203dcff924c3 (diff) | |
download | bugs-9eeb23d40782f3d62cf61e988ea0a2eca7d291a7.tar bugs-9eeb23d40782f3d62cf61e988ea0a2eca7d291a7.tar.gz bugs-9eeb23d40782f3d62cf61e988ea0a2eca7d291a7.tar.bz2 bugs-9eeb23d40782f3d62cf61e988ea0a2eca7d291a7.tar.xz bugs-9eeb23d40782f3d62cf61e988ea0a2eca7d291a7.zip |
Bug 737850 - Bug.history and Bug.get use different field names
r/a=LpSolit
-rw-r--r-- | Bugzilla/WebService/Bug.pm | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm index 940ab12fd..d163cf1a2 100644 --- a/Bugzilla/WebService/Bug.pm +++ b/Bugzilla/WebService/Bug.pm @@ -348,8 +348,10 @@ sub history { my $ids = $params->{ids}; defined $ids || ThrowCodeError('param_required', { param => 'ids' }); - my @return; + my %api_name = reverse %{ Bugzilla::Bug::FIELD_MAP() }; + $api_name{'bug_group'} = 'groups'; + my @return; foreach my $bug_id (@$ids) { my %item; my $bug = Bugzilla::Bug->check($bug_id); @@ -365,14 +367,15 @@ sub history { $bug_history{who} = $self->type('string', $changeset->{who}); $bug_history{changes} = []; foreach my $change (@{ $changeset->{changes} }) { + my $api_field = $api_name{$change->{fieldname}} || $change->{fieldname}; my $attach_id = delete $change->{attachid}; if ($attach_id) { $change->{attachment_id} = $self->type('int', $attach_id); } $change->{removed} = $self->type('string', $change->{removed}); $change->{added} = $self->type('string', $change->{added}); - $change->{field_name} = $self->type('string', - delete $change->{fieldname}); + $change->{field_name} = $self->type('string', $api_field); + delete $change->{fieldname}; push (@{$bug_history{changes}}, $change); } @@ -2109,6 +2112,10 @@ The same as L</get>. =item Added in Bugzilla B<3.4>. +=item Field names changed to be more consistent with other methods in Bugzilla B<4.4>. + +=item As of Bugzilla B<4.4>, field names now match names used by L<Bug.update|/"update"> for consistency. + =back =back |