summaryrefslogtreecommitdiffstats
path: root/Bugzilla/WebService/Bug.pm
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2013-10-18 17:26:13 +0200
committerDave Lawrence <dlawrence@mozilla.com>2013-10-18 17:26:13 +0200
commit6c94610a36860c288f0bf692ca111e4cf9052bb5 (patch)
tree32478e15943ee8f2e4a7e7a0af1780b86dd4d517 /Bugzilla/WebService/Bug.pm
parente8cca83b5284aa00287edfb75868da4f3f47b738 (diff)
downloadbugzilla-6c94610a36860c288f0bf692ca111e4cf9052bb5.tar.gz
bugzilla-6c94610a36860c288f0bf692ca111e4cf9052bb5.tar.xz
Bug 925780 - backport upstream bug 916254 to bmo/4.2 to extend Bug.get to return user details
Diffstat (limited to 'Bugzilla/WebService/Bug.pm')
-rw-r--r--Bugzilla/WebService/Bug.pm57
1 files changed, 57 insertions, 0 deletions
diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm
index b47cf7366..b952f346b 100644
--- a/Bugzilla/WebService/Bug.pm
+++ b/Bugzilla/WebService/Bug.pm
@@ -1069,6 +1069,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 };
@@ -1080,6 +1081,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 };
@@ -1104,6 +1106,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) }
@@ -1157,6 +1162,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) = @_;
@@ -2009,6 +2025,11 @@ C<string> The unique alias of this bug.
C<string> The login name of the user to whom the bug is assigned.
+=item C<assigned_to_detail>
+
+C<hash> A hash containing detailed user information for the assigned_to. To see the
+keys included in the user detail hash, see below.
+
=item C<blocks>
C<array> of C<int>s. The ids of bugs that are "blocked" by this bug.
@@ -2034,6 +2055,11 @@ C<dateTime> When the bug was created.
C<string> The login name of the person who filed this bug (the reporter).
+=item C<creator_detail>
+
+C<hash> A hash containing detailed user information for the creator. To see the
+keys included in the user detail hash, see below.
+
=item C<deadline>
C<string> The day that this bug is due to be completed, in the format
@@ -2158,6 +2184,11 @@ C<string> The name of the product this bug is in.
C<string> The login name of the current QA Contact on the bug.
+=item C<qa_contact_detail>
+
+C<hash> A hash containing detailed user information for the qa_contact. To see the
+keys included in the user detail hash, see below.
+
=item C<remaining_time>
C<double> The number of hours of work remaining until work on this bug
@@ -2233,6 +2264,30 @@ field types have different return values:
=back
+=item I<user detail hashes>
+
+Each user detail hash contains the following items:
+
+=over
+
+=item C<id>
+
+C<int> The user id for this user.
+
+=item C<real_name>
+
+C<string> The 'real' name for this user, if any.
+
+=item C<name>
+
+C<string> The user's Bugzilla login.
+
+=item C<email>
+
+C<string> The user's email address. Currently this is the same value as the name.
+
+=back
+
=back
=item C<faults> B<EXPERIMENTAL>
@@ -3310,6 +3365,8 @@ code of 32000.
=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<assigned_to_detail>, C<creator_detail>, C<qa_contact_detail>.
+
=back
=back