Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Retriving bug comments and history from Bugzilla REST API

620 views
Skip to first unread message

Sandeep Krishnan

unread,
Mar 29, 2016, 7:13:38 AM3/29/16
to support-...@lists.mozilla.org
Hello,

I am performing some analysis on defects in open source systems that use
Bugzilla as their defect database. I am trying to extract bug information
from Bugzilla using the REST API.

I started by extracting information for a given bug ID using the following
API

https://bugzilla.mozilla.org/rest/bug/35
https://bugzilla.mozilla.org/rest/bug/35/comment
https://bugzilla.mozilla.org/rest/bug/35/history

After reading the documentation on Wiki, I came to know that I can extract
data for multiple bugs by specifying multiple Bug Ids

e.g. https://bugzilla.mozilla.org/rest/bug?id=1000&id=1001&id=1002&...

But this only gives me bug info for all the specified bugs and not the
History and comments associated with the bugs.
I would like to know if I can do the same thing to get the History and
Comments data from Bugzilla. Based on documentation, it seems I can get the
comments and history for only a single bug at a time. Is there a way to
extract the History and Comments for for multiple bugs at a time? I would
like this so that it can reduce the number of API calls I make and reduce
the total time.

Thanks,
Sandeep

rutra...@gmail.com

unread,
Mar 30, 2016, 12:03:57 PM3/30/16
to
Hello,

What I've found during my analysis is (based on version 5.0.1):

.../rest/bug/1/comment?ids=2&ids=3&api_key=...

The response is: comments for bug id 1, 2, and 3.

However I agree that this is not clearly mentioned in docs.
Bugzilla Team - please comment.

Sandeep Krishnan

unread,
Mar 31, 2016, 12:12:13 AM3/31/16
to rutra...@gmail.com, support-...@lists.mozilla.org
Thanks a lot! That works. I had tried this but I had used "
.../rest/bug/1/comment?*id*=2&*id*=3&*id*=4..." instead of
"...*ids*=2&*ids*=3&..."
.

The only thing to make sure is that the bug id provided before the
"/comment?.." should be a valid bugID. It does not work for bugID 1 since I
get the response that it is not a valid bugID. But it worked when I gave a
valid bugID.

It would be nice if we can add this in the docs.

Thanks again.

Sandeep
> _______________________________________________
> support-bugzilla mailing list
> support-...@lists.mozilla.org
> https://lists.mozilla.org/listinfo/support-bugzilla
> PLEASE put support-...@lists.mozilla.org in the To: field when you
> reply.
>

rutra...@gmail.com

unread,
Mar 31, 2016, 2:55:28 AM3/31/16
to
> The only thing to make sure is that the bug id provided before the
> "/comment?.." should be a valid bugID.

I agree - this must be valid bugID.

Please wait for Bugzilla Team confirmation that this is proper way of working, as this is just what I found during REST analysis done in company where I work.
0 new messages