<div dir="ltr">I want to extract all information from a bug (comments, creator&#39;s name and email, QA&#39;s name and email, etc) and save it to a text file but I&#39;m not able to. I can only access some of the data. I&#39;m using Bugzilla version 4.2.5. Using <i><font color="#351c75">print dir(bz.getbug(8658))</font></i>, here is what I have access to the following (see attachment).<div><br></div><div>So long story short, I cannot/don&#39;t have access to <b>description</b>, <b>dupe_of</b>, <b>assigned_to</b>/<b>qa_contact </b>(can only get email but not the name), <b>estimated_time</b>, <b>actual_time</b>, <b>remaining_time</b>, getting all <b>comments </b>(with date, text, author, attachments reference) and <b>attachments </b>(file, date, author, description).</div><div><br></div><div>But some of these attributes are available as tags on the bug&#39;s XML page. So I thought maybe I could just parse the XML page and get all the info from there. Do you have any suggestions? Otherwise I&#39;m stuck because I can&#39;t get all the info I need.</div><div><br></div><div>Thanks, </div><div>Ravi<br><div><div><br></div><div><br></div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jan 13, 2015 at 4:04 PM, Cole Robinson <span dir="ltr">&lt;<a href="mailto:crobinso@redhat.com" target="_blank">crobinso@redhat.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sorry I didn&#39;t consider the auth issue.<br>
<br>
Modern bugzilla doesn&#39;t use cookies via the xmlrpc API, instead it uses a<br>
token which is API access only. So authenticating via python-bugzilla is not<br>
going to give you any way of accessing a regular bugzilla URL with auth. So<br>
there&#39;s no easy way that I can think of.<br>
<br>
What are you trying to achieve exactly? Why do you need the bug XML output?<br>
All that information should be available via the python-bugzilla API, so maybe<br>
you can achieve what you need in a different way<br>
<br>
- Cole<br>
<span class=""><br>
On 01/13/2015 03:56 PM, Ravikumar Patel wrote:<br>
&gt; Thanks for the help. Could you help me with that because I am having login<br>
&gt; issues from a couple of stuff I found on the web? Or can you provide me with<br>
&gt; any helpful links?<br>
&gt;<br>
&gt; So far I have looked at these and I keep getting a dummy html page (not<br>
&gt; related to the bug) instead of the XML page for the bug:<br>
&gt;<br>
&gt; <a href="http://stackoverflow.com/questions/189555/how-to-use-python-to-login-to-a-webpage-and-retrieve-cookies-for-later-usage" target="_blank">http://stackoverflow.com/questions/189555/how-to-use-python-to-login-to-a-webpage-and-retrieve-cookies-for-later-usage</a><br>
&gt; <a href="http://stackoverflow.com/questions/11167419/get-xml-data-from-bugzilla-url" target="_blank">http://stackoverflow.com/questions/11167419/get-xml-data-from-bugzilla-url</a><br>
&gt;<br>
&gt; On Tue, Jan 13, 2015 at 3:38 PM, Cole Robinson &lt;<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a><br>
</span><span class="">&gt; &lt;mailto:<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a>&gt;&gt; wrote:<br>
&gt;<br>
&gt;     I guess you can just generate that URL from the bug&#39;s ID, then use standard<br>
&gt;     python urllib or similar to fetch the web page contents. I don&#39;t think there&#39;s<br>
&gt;     any bugzilla API call that does what you want though<br>
&gt;<br>
&gt;     - Cole<br>
&gt;<br>
&gt;     On 01/13/2015 03:35 PM, Ravikumar Patel wrote:<br>
&gt;     &gt; I&#39;ll guide you through the steps I&#39;ve followed to clarify what I mean. First,<br>
&gt;     &gt; I queried for all bugs for a specific person. I then got a list of bugs for<br>
&gt;     &gt; that person with all of their bug IDs. I clicked on one of the bug ID and it<br>
&gt;     &gt; gave me a page with that bug&#39;s summary, status, aliases, product, etc. Once<br>
&gt;     &gt; you get to the bottom of the page, you have a link to it&#39;s XML view/page. (see<br>
&gt;     &gt; screenshot below)<br>
&gt;     &gt;<br>
&gt;     &gt; Inline image 1<br>
&gt;     &gt;<br>
&gt;     &gt; Now I want to get access to this page (using my python script from previous<br>
&gt;     &gt; emails):<br>
&gt;     &gt; Inline image 3<br>
&gt;     &gt;<br>
&gt;     &gt; I want to know if I can access this XML page from a corresponding bug ID via a<br>
&gt;     &gt; python script?<br>
&gt;     &gt;<br>
&gt;     &gt; Thanks,<br>
&gt;     &gt; Ravi<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt; On Tue, Jan 13, 2015 at 2:25 PM, Cole Robinson &lt;<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a> &lt;mailto:<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a>&gt;<br>
</span><div><div class="h5">&gt;     &gt; &lt;mailto:<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a> &lt;mailto:<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a>&gt;&gt;&gt; wrote:<br>
&gt;     &gt;<br>
&gt;     &gt;     I don&#39;t know what you mean by &#39;xml page&#39;<br>
&gt;     &gt;<br>
&gt;     &gt;     - Cole<br>
&gt;     &gt;<br>
&gt;     &gt;     On 01/13/2015 02:23 PM, Ravikumar Patel wrote:<br>
&gt;     &gt;     &gt; This is a follow up question. How do I now access each bug&#39;s XML page now that<br>
&gt;     &gt;     &gt; I have the bug IDs I needed?<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt; On Tue, Jan 13, 2015 at 1:34 PM, Cole Robinson &lt;<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a> &lt;mailto:<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a>&gt;<br>
&gt;     &lt;mailto:<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a> &lt;mailto:<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a>&gt;&gt;<br>
&gt;     &gt;     &gt; &lt;mailto:<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a> &lt;mailto:<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a>&gt;<br>
&gt;     &lt;mailto:<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a> &lt;mailto:<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a>&gt;&gt;&gt;&gt; wrote:<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     On 01/13/2015 12:59 PM, Ravikumar Patel wrote:<br>
&gt;     &gt;     &gt;     &gt; Hello,<br>
&gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt; I am trying to get the bug ID of all bugs from my Bugzilla account. Any<br>
&gt;     &gt;     &gt;     &gt; suggestions as to how I am able to do so? Is it possible that to query for all<br>
&gt;     &gt;     &gt;     &gt; projects and then access the bug IDs from each project? If so, then how?<br>
&gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt; So far my code looks like this:<br>
&gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt; |bz = bugzilla.Bugzilla(url=&#39;<a href="https://bugzilla.mycompany.com/xmlrpc.cgi" target="_blank">https://bugzilla.mycompany.com/xmlrpc.cgi</a>&#39;)<br>
&gt;     &gt;     &gt;     &gt; try:<br>
&gt;     &gt;     &gt;     &gt;    bz.login(&#39;<a href="mailto:name@email.com">name@email.com</a> &lt;mailto:<a href="mailto:name@email.com">name@email.com</a>&gt; &lt;mailto:<a href="mailto:name@email.com">name@email.com</a><br>
&gt;     &lt;mailto:<a href="mailto:name@email.com">name@email.com</a>&gt;&gt; &lt;mailto:<a href="mailto:name@email.com">name@email.com</a> &lt;mailto:<a href="mailto:name@email.com">name@email.com</a>&gt;<br>
&gt;     &gt;     &lt;mailto:<a href="mailto:name@email.com">name@email.com</a> &lt;mailto:<a href="mailto:name@email.com">name@email.com</a>&gt;&gt;&gt;<br>
&gt;     &gt;     &gt;     &lt;mailto:<a href="mailto:name@email.com">name@email.com</a> &lt;mailto:<a href="mailto:name@email.com">name@email.com</a>&gt; &lt;mailto:<a href="mailto:name@email.com">name@email.com</a><br>
&gt;     &lt;mailto:<a href="mailto:name@email.com">name@email.com</a>&gt;&gt;<br>
&gt;     &gt;     &lt;mailto:<a href="mailto:name@email.com">name@email.com</a> &lt;mailto:<a href="mailto:name@email.com">name@email.com</a>&gt; &lt;mailto:<a href="mailto:name@email.com">name@email.com</a><br>
&gt;     &lt;mailto:<a href="mailto:name@email.com">name@email.com</a>&gt;&gt;&gt;&gt;&#39;, &#39;password&#39;);<br>
&gt;     &gt;     &gt;     &gt;    print&#39;Authorization cookie received.&#39;<br>
&gt;     &gt;     &gt;     &gt; except bugzilla.BugzillaError:<br>
&gt;     &gt;     &gt;     &gt;    print(str(sys.exc_info()[1]))<br>
&gt;     &gt;     &gt;     &gt;    sys.exit(1)|<br>
&gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt; Here is the link to the stackoverflow question page:<br>
&gt;     &gt;     &gt;     &gt; <a href="http://stackoverflow.com/questions/27869663/how-do-i-query-bugzilla-to-get-all-the-bug-ids-using-python-and-xml-rpc" target="_blank">http://stackoverflow.com/questions/27869663/how-do-i-query-bugzilla-to-get-all-the-bug-ids-using-python-and-xml-rpc</a><br>
&gt;     &gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     &gt; I really need help on this. Any suggestions?<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     bugs = bz.query(bz.build_query(assigned_to=&quot;your-bugzilla-account&quot;))<br>
&gt;     &gt;     &gt;     for bug in bugs:<br>
</div></div>&gt;     &gt;     &gt;         print <a href="http://bug.id" target="_blank">bug.id</a> &lt;<a href="http://bug.id" target="_blank">http://bug.id</a>&gt; &lt;<a href="http://bug.id" target="_blank">http://bug.id</a>&gt; &lt;<a href="http://bug.id" target="_blank">http://bug.id</a>&gt;<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;     - Cole<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;     &gt;<br>
&gt;     &gt;<br>
&gt;     &gt;<br>
&gt;<br>
&gt;<br>
<br>
</blockquote></div><br></div>