<div dir="ltr">I want to extract all information from a bug (comments, creator's name and email, QA's name and email, etc) and save it to a text file but I'm not able to. I can only access some of the data. I'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'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'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'm stuck because I can'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"><<a href="mailto:crobinso@redhat.com" target="_blank">crobinso@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Sorry I didn't consider the auth issue.<br>
<br>
Modern bugzilla doesn'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'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>
> Thanks for the help. Could you help me with that because I am having login<br>
> issues from a couple of stuff I found on the web? Or can you provide me with<br>
> any helpful links?<br>
><br>
> So far I have looked at these and I keep getting a dummy html page (not<br>
> related to the bug) instead of the XML page for the bug:<br>
><br>
> <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>
> <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>
><br>
> On Tue, Jan 13, 2015 at 3:38 PM, Cole Robinson <<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a><br>
</span><span class="">> <mailto:<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a>>> wrote:<br>
><br>
> I guess you can just generate that URL from the bug's ID, then use standard<br>
> python urllib or similar to fetch the web page contents. I don't think there's<br>
> any bugzilla API call that does what you want though<br>
><br>
> - Cole<br>
><br>
> On 01/13/2015 03:35 PM, Ravikumar Patel wrote:<br>
> > I'll guide you through the steps I've followed to clarify what I mean. First,<br>
> > I queried for all bugs for a specific person. I then got a list of bugs for<br>
> > that person with all of their bug IDs. I clicked on one of the bug ID and it<br>
> > gave me a page with that bug's summary, status, aliases, product, etc. Once<br>
> > you get to the bottom of the page, you have a link to it's XML view/page. (see<br>
> > screenshot below)<br>
> ><br>
> > Inline image 1<br>
> ><br>
> > Now I want to get access to this page (using my python script from previous<br>
> > emails):<br>
> > Inline image 3<br>
> ><br>
> > I want to know if I can access this XML page from a corresponding bug ID via a<br>
> > python script?<br>
> ><br>
> > Thanks,<br>
> > Ravi<br>
> ><br>
> ><br>
> > On Tue, Jan 13, 2015 at 2:25 PM, Cole Robinson <<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a> <mailto:<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a>><br>
</span><div><div class="h5">> > <mailto:<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a> <mailto:<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a>>>> wrote:<br>
> ><br>
> > I don't know what you mean by 'xml page'<br>
> ><br>
> > - Cole<br>
> ><br>
> > On 01/13/2015 02:23 PM, Ravikumar Patel wrote:<br>
> > > This is a follow up question. How do I now access each bug's XML page now that<br>
> > > I have the bug IDs I needed?<br>
> > ><br>
> > > On Tue, Jan 13, 2015 at 1:34 PM, Cole Robinson <<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a> <mailto:<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a>><br>
> <mailto:<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a> <mailto:<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a>>><br>
> > > <mailto:<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a> <mailto:<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a>><br>
> <mailto:<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a> <mailto:<a href="mailto:crobinso@redhat.com">crobinso@redhat.com</a>>>>> wrote:<br>
> > ><br>
> > > On 01/13/2015 12:59 PM, Ravikumar Patel wrote:<br>
> > > > Hello,<br>
> > > ><br>
> > > > I am trying to get the bug ID of all bugs from my Bugzilla account. Any<br>
> > > > suggestions as to how I am able to do so? Is it possible that to query for all<br>
> > > > projects and then access the bug IDs from each project? If so, then how?<br>
> > > ><br>
> > > > So far my code looks like this:<br>
> > > ><br>
> > > > |bz = bugzilla.Bugzilla(url='<a href="https://bugzilla.mycompany.com/xmlrpc.cgi" target="_blank">https://bugzilla.mycompany.com/xmlrpc.cgi</a>')<br>
> > > > try:<br>
> > > > bz.login('<a href="mailto:name@email.com">name@email.com</a> <mailto:<a href="mailto:name@email.com">name@email.com</a>> <mailto:<a href="mailto:name@email.com">name@email.com</a><br>
> <mailto:<a href="mailto:name@email.com">name@email.com</a>>> <mailto:<a href="mailto:name@email.com">name@email.com</a> <mailto:<a href="mailto:name@email.com">name@email.com</a>><br>
> > <mailto:<a href="mailto:name@email.com">name@email.com</a> <mailto:<a href="mailto:name@email.com">name@email.com</a>>>><br>
> > > <mailto:<a href="mailto:name@email.com">name@email.com</a> <mailto:<a href="mailto:name@email.com">name@email.com</a>> <mailto:<a href="mailto:name@email.com">name@email.com</a><br>
> <mailto:<a href="mailto:name@email.com">name@email.com</a>>><br>
> > <mailto:<a href="mailto:name@email.com">name@email.com</a> <mailto:<a href="mailto:name@email.com">name@email.com</a>> <mailto:<a href="mailto:name@email.com">name@email.com</a><br>
> <mailto:<a href="mailto:name@email.com">name@email.com</a>>>>>', 'password');<br>
> > > > print'Authorization cookie received.'<br>
> > > > except bugzilla.BugzillaError:<br>
> > > > print(str(sys.exc_info()[1]))<br>
> > > > sys.exit(1)|<br>
> > > ><br>
> > > > Here is the link to the stackoverflow question page:<br>
> > > > <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>
> > > ><br>
> > > > I really need help on this. Any suggestions?<br>
> > ><br>
> > > bugs = bz.query(bz.build_query(assigned_to="your-bugzilla-account"))<br>
> > > for bug in bugs:<br>
</div></div>> > > print <a href="http://bug.id" target="_blank">bug.id</a> <<a href="http://bug.id" target="_blank">http://bug.id</a>> <<a href="http://bug.id" target="_blank">http://bug.id</a>> <<a href="http://bug.id" target="_blank">http://bug.id</a>><br>
> > ><br>
> > > - Cole<br>
> > ><br>
> > ><br>
> > ><br>
> > ><br>
> ><br>
> ><br>
><br>
><br>
<br>
</blockquote></div><br></div>