From 2e920979ebe3ecead46c4b2982041fd86155a4dd Mon Sep 17 00:00:00 2001 From: "mkanat%bugzilla.org" <> Date: Tue, 20 Jan 2009 20:24:31 +0000 Subject: Bug 472954: Expose additional properties via the WebService::Bug.get interface Patch By Kip Hampton r=mkanat, a=mkanat --- Bugzilla/WebService/Bug.pm | 101 ++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 91 insertions(+), 10 deletions(-) (limited to 'Bugzilla') diff --git a/Bugzilla/WebService/Bug.pm b/Bugzilla/WebService/Bug.pm index 9d58538f2..5626d1a84 100755 --- a/Bugzilla/WebService/Bug.pm +++ b/Bugzilla/WebService/Bug.pm @@ -162,7 +162,20 @@ sub get { $item{'internals'} = $bug; $item{'id'} = $self->type('int', $bug->bug_id); $item{'summary'} = $self->type('string', $bug->short_desc); - + $item{'assigned_to'} = $self->type('string', $bug->assigned_to->login ); + $item{'resolution'} = $self->type('string', $bug->resolution); + $item{'status'} = $self->type('string', $bug->bug_status); + $item{'is_open'} = $self->type('boolean', $bug->status->is_open); + $item{'severity'} = $self->type('string', $bug->bug_severity); + $item{'priority'} = $self->type('string', $bug->priority); + $item{'product'} = $self->type('string', $bug->product); + $item{'component'} = $self->type('string', $bug->component); + $item{'dupe_of'} = $self->type('int', $bug->dup_id); + + # if we do not delete this key, additional user info, including their + # real name, etc, will wind up in the 'internals' hashref + delete $item{internals}->{assigned_to_obj}; + if (Bugzilla->params->{'usebugaliases'}) { $item{'alias'} = $self->type('string', $bug->alias); } @@ -171,7 +184,7 @@ sub get { # don't want it to have a value if aliases are turned off. $item{'alias'} = undef; } - + push(@return, \%item); } @@ -567,26 +580,31 @@ Each hash contains the following items: =over -=item id - -C The numeric bug_id of this bug. - =item alias C The alias of this bug. If there is no alias or aliases are disabled in this Bugzilla, this will be an empty string. -=item summary +=item assigned_to -C The summary of this bug. +C The login name of the user to whom the bug is assigned. + +=item component + +C The name of the current component of this bug. =item creation_time C When the bug was created. -=item last_change_time +=item dupe_of -C When the bug was last changed. +C The bug ID of the bug that this bug is a duplicate of. If this bug +isn't a duplicate of any bug, this will be an empty int. + +=item id + +C The numeric bug_id of this bug. =item internals B @@ -594,6 +612,38 @@ A hash. The internals of a L object. This is extremely unstable, and you should only rely on this if you absolutely have to. The structure of the hash may even change between point releases of Bugzilla. +=item is_open + +C Returns true (1) if this bug is open, false (0) if it is closed. + +=item last_change_time + +C When the bug was last changed. + +=item priority + +C The priority of the bug. + +=item product + +C The name of the product this bug is in. + +=item resolution + +C The current resolution of the bug, or an empty string if the bug is open. + +=item severity + +C The current severity of the bug. + +=item status + +C The current status of the bug. + +=item summary + +C The summary of this bug. + =back =item B @@ -615,6 +665,37 @@ You do not have access to the bug_id you specified. =back +=item B + +=over + +=item The following properties were added to this method's return value +in Bugzilla B<3.4>: + +=over + +=item assigned_to + +=item component + +=item dupe_of + +=item is_open + +=item priority + +=item product + +=item resolution + +=item severity + +=item status + +=back + +=back + =back =item C -- cgit v1.2.3-24-g4f1b