Bug 218982

Summary: [feature] add the 'flags' to the output of xml-rpc interface
Product: [Community] Bugzilla Reporter: Don Zickus <dzickus>
Component: Bugzilla GeneralAssignee: Bernd Groh <bgroh>
Status: CLOSED CURRENTRELEASE QA Contact: David Lawrence <dkl>
Severity: medium Docs Contact:
Priority: medium    
Version: develCC: ebaak
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 2.18 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-12-09 00:08:40 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Don Zickus 2006-12-08 21:20:05 UTC
Description of problem:
I like the use the bugzilla xml-rpc interface to verify posted kernel bugzillas
in real-time.  Mainly to catch typos and make sure the bug is in the correct
state for the correct component.  

With the upcoming rhel5 RC1, I have been asked to only take patches whose
bugzillas have the appropriate "blocker flags" set.  It would be easier to do
this in real-time with the xml-rpc interface _if_ that info was provided. 
Otherwise I have to manually peruse a blocker list and compare it to the posted
bugzilla.   :(  

Unless there are other commands that can retrieve this rather quickly.

Comment 1 David Lawrence 2006-12-09 00:08:40 UTC
The flags are actually included in the bugzilla.getBug(bugid, username,
password) call. Although it is kind of cryptic in its output. Look for a
toplevel key named 'flag_types'. It is a list of possible data structs that are
flags that can be set for that particular bug. If any flags have actually been
set to either '+', '-', or '?', then there is a key called 'flags' under that
that is a list of data structs containing the flag data. Just iterate through
the list and look for a key called 'type' which is a pointer to a struct data
that has the key 'name'. Just skip the ones you are not interested in. There is
also a key called 'status' to see which symbol the flag is set to. 

example:

'flag_types' => [
                          {
                            'flags' => [
                                       {
                                         'target' => {
                                                     'type' => 'bug',
                                                     'exists' => '1',
                                                     'bug' => {
                                                              'bug_status' =>
'MODIFIED',
                                                              'version' => '5.0.0',
                                                              'component_id' =>
'18961',
                                                              'restricted' => '2',
                                                              'component' =>
'libgtk-java',
                                                              'summary' =>
'multilib conflicts (libgtk-java)',
                                                              'product_id' => '42',
                                                              'product' => 'Red
Hat Enterprise Linux Beta',
                                                              'id' => '210566',
                                                              'exists' => '1'
                                                            }
                                                   },
                                         'requestee' => '',
                                         'status' => '+',
                                         'id' => '37136',
                                         'type' => {
                                                   'sortkey' => '13',
                                                   'request_gid' => '92',
                                                   'name' => 'qa_ack',
                                                   'description' => 'Quality
Assurance Acknowledgement',
                                                   'cc_list' =>
'eng-process-list',
                                                   'is_requestable' => '1',
                                                   'is_multiplicable' => '0',
                                                   'is_requesteeble' => '0',
                                                   'view_gid' => '92',
                                                   'is_active' => '1',
                                                   'flag_count' => '',
                                                   'target_type' => 'bug',
                                                   'id' => '9',
                                                   'exists' => '1',
                                                   'grant_gid' => '11'
                                                 },
                                        'setter' => {
                                                     'safe_email' =>
'jturner',
                                                     'name' => 'Jay Turner',
                                                     'id' => '405',
                                                     'login' =>
'jturner',
                                                     'showmybugslink' => '1'
                                                   }
                                       }
                                     ],
                            'sortkey' => '13',
                            'request_gid' => '92',
                            'name' => 'qa_ack',
                            'description' => 'Quality Assurance Acknowledgement',
                            'cc_list' => 'eng-process-list',
                            'is_requestable' => '1',
                            'is_multiplicable' => '0',
                            'is_requesteeble' => '0',
                            'is_active' => '1',
                            'view_gid' => '92',
                            'flag_count' => '',
                            'target_type' => 'bug',
                            'id' => '9',
                            'exists' => '1',
                            'grant_gid' => '11'
                          }
                        ],


Comment 2 Don Zickus 2006-12-12 17:09:22 UTC
I was wondering the other day if it was possible to grab everything out of the
bugzilla through an xml-rpc interface (not that I have any use currently).  This
looks like it should solve my problem.  

I'll spend some time trying to hack up some perl for this.  If I fail, I'll
probably bother you again.