Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 297432 Details for
Bug 427883
XMLRPC functions getBug() and getBugSimple() to be replaced by Bug.get()
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Bugzilla::WebService::Bug::get()
patch.diff (text/plain), 6.66 KB, created by
Noura El hawary
on 2008-03-10 13:58:27 UTC
(
hide
)
Description:
Bugzilla::WebService::Bug::get()
Filename:
MIME Type:
Creator:
Noura El hawary
Created:
2008-03-10 13:58:27 UTC
Size:
6.66 KB
patch
obsolete
>Index: Bugzilla/WebService/Bug.pm >=================================================================== >RCS file: /cvs/qa/rh_bugzilla_3/Bugzilla/WebService/Bug.pm,v >retrieving revision 1.6 >diff -p -u -r1.6 Bug.pm >--- Bugzilla/WebService/Bug.pm 29 Feb 2008 04:01:24 -0000 1.6 >+++ Bugzilla/WebService/Bug.pm 10 Mar 2008 13:55:43 -0000 >@@ -38,13 +38,24 @@ use Bugzilla::Constants; > # This maps the names of internal Bugzilla bug fields to things that would > # make sense to somebody who's not intimately familiar with the inner workings > # of Bugzilla. (These are the field names that the WebService uses.) >+# REDHAT EXTENSION START 406151 >+# adding redhat custom fields to the mapping starting with cf_* > use constant FIELD_MAP => { >- status => 'bug_status', >- severity => 'bug_severity', >- description => 'comment', >- summary => 'short_desc', >- platform => 'rep_platform', >+ status => 'bug_status', >+ severity => 'bug_severity', >+ description => 'comment', >+ summary => 'short_desc', >+ platform => 'rep_platform', >+ comments => 'longdescs', >+ url => 'bug_file_loc', >+ milestone_url => 'url', >+ qa_whiteboard => 'cf_qa_whiteboard', >+ devel_whiteboard => 'cf_devel_whiteboard', >+ internal_whiteboard => 'cf_internal_whiteboard', >+ fixed_in => 'cf_fixed_in', >+ cust_facing => 'cf_cust_facing', > }; >+# REDHAT EXTENSION END 406151 > > use constant GLOBAL_SELECT_FIELDS => qw( > bug_severity >@@ -67,6 +78,9 @@ BEGIN { *get_bugs = \&get } > # Methods # > ########### > >+# now the function can be called with optional hashkey fields as the following: >+# $call = $rpc->call( 'Bug.get', { ids => [1,3] , fields => ['status', 'groups', 'keywords', 'comments']} ); >+# the unstable internal section will be replaced with the passed in list of fields. > sub get { > my ($self, $params) = @_; > my $ids = $params->{ids}; >@@ -76,6 +90,7 @@ sub get { > foreach my $bug_id (@$ids) { > ValidateBugID($bug_id); > my $bug = new Bugzilla::Bug($bug_id); >+ my $b = new Bugzilla::Bug($bug_id); > > # Timetracking fields are deleted if the user doesn't belong to > # the corresponding group. >@@ -92,10 +107,54 @@ sub get { > my %item; > $item{'creation_time'} = type('dateTime')->value($creation_ts); > $item{'last_change_time'} = type('dateTime')->value($delta_ts); >- $item{'internals'} = $bug; > $item{'id'} = type('int')->value($bug->bug_id); > $item{'summary'} = type('string')->value($bug->short_desc); >+ my $internals; >+ >+ # if the user has specified a list of fields that they want >+ # to get for the bug ids they are passing then return that list >+ # instead of the internals section, otherwise if no fields >+ # are specified then return the internals section >+ if ($params->{fields}) { >+ $item{internals} = {}; >+ $internals = $item{internals}; >+ foreach my $field ( @{ $params->{fields} } ) { >+ my $field_name = FIELD_MAP->{$field} || $field; >+ $internals->{$field_name} = $bug->$field_name; >+ } >+ } >+ elsif ($params->{all}) { >+ $item{internals} = $bug; >+ $internals = $bug; >+ $internals->{cc} = $b->cc; >+ $internals->{dependson} = $b->dependson; >+ $internals->{blocked} = $b->blocked; >+ $internals->{longdescs} = $b->longdescs; >+ $internals->{keywords} = $b->keywords; >+ $internals->{groups} = $b->groups; >+ $internals->{attachments} = $b->attachments; >+ $internals->{flag_types} = $b->flag_types; >+ $internals->{dupe_id} = $b->dup_id; >+ $internals->{actual_time} = $b->actual_time; >+ $internals->{milestone_url} = $b->milestoneurl; >+ } >+ else { >+ $item{internals} = $bug; >+ $internals = $bug; >+ } >+ >+ # convert ids to names >+ $internals->{qa_contact} = type('string')->value($b->qa_contact->login) >+ if ($internals->{qa_contact} && $b->qa_contact); >+ $internals->{assigned_to} = type('string')->value($b->assigned_to->login) >+ if $internals->{assigned_to}; >+ $internals->{reporter} = type('string')->value($b->reporter->login) >+ if $internals->{reporter_id}; >+ $internals->{product} = type('string')->value($b->product) if $internals->{product_id}; >+ $internals->{component} = type('string')->value($b->component) if $internals->{component_id}; >+ > >+ > if (Bugzilla->params->{'usebugaliases'}) { > $item{'alias'} = type('string')->value($bug->alias); > } >@@ -327,7 +386,7 @@ Note: Can also be called as "get_bugs" f > > =over > >-=item C<ids> >+=item C<ids> B<Required> > > An array of numbers and strings. > >@@ -340,6 +399,24 @@ Note that it's possible for aliases to b > case you will be told that you have specified an invalid bug_id if you > try to specify an alias. (It will be error 100.) > >+=item C<all> B<Optional> >+ >+A boolean value. If true then all the bug information will be returned. >+ >+=item C<fields> B<Optional> >+ >+An array of strings. Each element in the array is a bug field or attribute >+that the user would like to get. >+The fields array can contain any of the following field names: >+ >+summary, priority, longdescs, bug_id, keywords, qa_whiteboard, cclist_accessible, >+cc, assigned_to, cust_facing, groups, blocked, everconfirmed, qa_contact, short_desc, >+bug_severity, reporter_id, estimated_time, remaining_time, milestone_url, reporter_accessible, >+resolution, devel_whiteboard, alias, op_sys, reporter, url, product_id, rep_platform, >+dupe_id, creation_ts, flag_types, status_whiteboard, bug_status, delta_ts, attachments, >+version, deadline, component_id, component, actual_time, fixed_in, dependson, >+target_milestone, product, creation_time, last_change_time. >+ > =back > > =item B<Returns> >@@ -376,6 +453,12 @@ A hash. The internals of a L<Bugzilla::B > 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. > >+The internals hash contains full bug information if the user sets the all >+parameter to true. If the user passes fields param that contains specific >+bug fields then only those bug fields will be returned in the internals hash. >+If the user didn't pass fields param or set the all param to true then only >+basic bug information will be returned in the internals hash. >+ > =back > > =item B<Errors>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
dkl
: review-
Actions:
View
|
Diff
Attachments on
bug 427883
:
297050
|
297432
|
297556