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 297050 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.10 KB, created by
Noura El hawary
on 2008-03-06 14:15:44 UTC
(
hide
)
Description:
Bugzilla::WebService::Bug::get()
Filename:
MIME Type:
Creator:
Noura El hawary
Created:
2008-03-06 14:15:44 UTC
Size:
6.10 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 -u -r1.6 Bug.pm >--- Bugzilla/WebService/Bug.pm 29 Feb 2008 04:01:24 -0000 1.6 >+++ Bugzilla/WebService/Bug.pm 6 Mar 2008 14:11:02 -0000 >@@ -38,13 +38,24 @@ > # 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 @@ > # 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 @@ > 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,44 @@ > 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); > >+ # 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}) { >+ foreach my $field ( @{ $params->{fields} } ) { >+ my $field_name = FIELD_MAP->{$field} || $field; >+ $item{$field_name} = $bug->$field_name; >+ } >+ $item{qa_contact} = type('string')->value($b->qa_contact->login) if $b->qa_contact; >+ $item{assigned_to} = type('string')->value($b->assigned_to->login); >+ $item{reporter} = type('string')->value($b->reporter->login); >+ } >+ else { >+ my $b = new Bugzilla::Bug($bug_id); >+ $item{internals} = $bug; >+ my $internals = $item{internals}; >+ $internals->{qa_contact} = type('string')->value($b->qa_contact->login) if $b->qa_contact; >+ $internals->{assigned_to} = type('string')->value($b->assigned_to->login); >+ $internals->{reporter} = type('string')->value($b->reporter->login); >+ $internals->{cc} = $b->cc, >+ $internals->{product} = type('string')->value($b->product); >+ $internals->{component} = type('string')->value($b->component); >+ $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; >+ } >+ > if (Bugzilla->params->{'usebugaliases'}) { > $item{'alias'} = type('string')->value($bug->alias); > } >@@ -340,6 +389,23 @@ > 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<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. >+ >+Note that this item is optional. If the user doesn't specify the fields they want >+to get information about for the bug, then they get full bug information. >+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 +442,10 @@ > 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. > >+Note: The internals hash will only be returned if the user didn't specify any >+fields they want in return which means that they didn't pass fields array. >+Otherwise the internals hash will be replaced with the fields that the user sepcified. >+ > =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
Actions:
View
|
Diff
Attachments on
bug 427883
:
297050
|
297432
|
297556