From 2516718aec9fe1a005f15e99b459ca092d0f9970 Mon Sep 17 00:00:00 2001 From: Frank Becker Date: Fri, 11 Oct 2013 11:39:12 -0400 Subject: Bug 916254 - Bug.get should include the name for reporter, assigned_to and qa_contact r=dkl,a=sgreen --- Bugzilla/WebService/Bug.pm | 57 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) (limited to 'Bugzilla') diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm index e2b06a378..0760503a6 100644 --- a/Bugzilla/WebService/Bug.pm +++ b/Bugzilla/WebService/Bug.pm @@ -1045,6 +1045,7 @@ sub _bug_to_hash { # eliminate them anyway. if (filter_wants $params, 'assigned_to') { $item{'assigned_to'} = $self->type('email', $bug->assigned_to->login); + $item{'assigned_to_detail'} = $self->_user_to_hash($bug->assigned_to, $params, 'assigned_to'); } if (filter_wants $params, 'blocks') { my @blocks = map { $self->type('int', $_) } @{ $bug->blocked }; @@ -1062,6 +1063,7 @@ sub _bug_to_hash { } if (filter_wants $params, 'creator') { $item{'creator'} = $self->type('email', $bug->reporter->login); + $item{'creator_detail'} = $self->_user_to_hash($bug->reporter, $params, 'creator'); } if (filter_wants $params, 'depends_on') { my @depends_on = map { $self->type('int', $_) } @{ $bug->dependson }; @@ -1089,6 +1091,9 @@ sub _bug_to_hash { if (filter_wants $params, 'qa_contact') { my $qa_login = $bug->qa_contact ? $bug->qa_contact->login : ''; $item{'qa_contact'} = $self->type('email', $qa_login); + if ($bug->qa_contact) { + $item{'qa_contact_detail'} = $self->_user_to_hash($bug->qa_contact, $params, 'qa_contact'); + } } if (filter_wants $params, 'see_also') { my @see_also = map { $self->type('string', $_->name) } @@ -1141,6 +1146,17 @@ sub _bug_to_hash { return filter $params, \%item; } +sub _user_to_hash { + my ($self, $user, $filters, $prefix) = @_; + my $item = filter $filters, { + id => $self->type('int', $user->id), + real_name => $self->type('string', $user->name), + name => $self->type('email', $user->login), + email => $self->type('email', $user->email), + }, $prefix; + return $item; +} + sub _attachment_to_hash { my ($self, $attach, $filters) = @_; @@ -2006,6 +2022,11 @@ C The unique alias of this bug. C The login name of the user to whom the bug is assigned. +=item C + +C A hash containing detailed user information for the assigned_to. To see the +keys included in the user detail hash, see below. + =item C C of Cs. The ids of bugs that are "blocked" by this bug. @@ -2031,6 +2052,11 @@ C When the bug was created. C The login name of the person who filed this bug (the reporter). +=item C + +C A hash containing detailed user information for the creator. To see the +keys included in the user detail hash, see below. + =item C C The day that this bug is due to be completed, in the format @@ -2152,6 +2178,11 @@ C The name of the product this bug is in. C The login name of the current QA Contact on the bug. +=item C + +C A hash containing detailed user information for the qa_contact. To see the +keys included in the user detail hash, see below. + =item C C The number of hours of work remaining until work on this bug @@ -2227,6 +2258,30 @@ field types have different return values: =back +=item I + +Each user detail hash contains the following items: + +=over + +=item C + +C The user id for this user. + +=item C + +C The 'real' name for this user, if any. + +=item C + +C The user's Bugzilla login. + +=item C + +C The user's email address. Currently this is the same value as the name. + +=back + =back =item C B @@ -2328,6 +2383,8 @@ in Bugzilla B<4.4>. =item REST API call added in Bugzilla B<5.0>. +=item In Bugzilla B<5.0>, the following items were added to the bugs return value: C, C, C. + =back =back -- cgit v1.2.3-24-g4f1b