Javascript API for Bugzilla XML-RPC Web Services

UPDATE: use bz.js instead!

The QAC (QA Companion) is a Firefox add-on that lets beta testers easily find bugs, run manual test cases on the browser, and get involved in the Mozilla community. Right now it’s a bit out of date and fragile. We’re going to be completely redesigning and reimplementing it. One thing we needed for it was a way to create and search for bugs in Bugzilla. The only way to do this is through Bugzilla’s XML-RPC interface. So my first project was to create a Javascript library that interfaces with Bugzilla’s web services interface. This basically acts as a JSON-RPC library that wraps the XML-RPC functionality (in Bugzilla 3.5 there will be a JSON-RPC interface).

The API docs are here as well as a link to download: bugzillaRPC. Because the library makes HTTP requests to the Bugzilla server, you can’t use it from regular content. You can however use it from any extension or chrome-privileged code. One thing we had hoped to have was account creation functionality. Unfortunately, a user with ‘editaccount’ privileges must be logged in to create an account for another user. This is a security hole for our project, but there is functionality for offering a user an account by sending them an email. I didn’t implement every function in the Bugzilla Web Services API, mainly the ones the project uses, but it’s extremely easy to extend. We hope other people can use this!

7 thoughts on “Javascript API for Bugzilla XML-RPC Web Services

  1. Thanks for the javascript! I’ve used it at our company to make a jquery based simple webapp for support based ticketing. Its been working really well, except that it appears that the ‘advancedSearch’ function doesn’t return any results in IE – not a problem for me of course, but (sigh), an issue for others.

    1. glad you found it useful! The advanced search is a bit different in that it gets the xml of the bug list from and advanced search and queries it for bug ids, it’s likely that this is because Internet Explorer doesn’t support document.getElementsByTagName, so it should be an easy fix, I just didn’t expect this to be used on IE (-:

  2. My mistake, IE does support getElementsByTagName, was thinking of getElementsByClassName, not sure why it doesn’t work then, I’ll look into it.

  3. I’m given a task to synchronize bugzilla with the HP quality Center . can anyone suggest me how to go about . I’m a fresher and i request you to help with out with a lil details..

  4. This looks really promising – I’ve been trying to use it against our local installation but I’m getting “Connection error: HTTP code 0”

    I’m thinking it’s probably because I’m not running it from chrome-privileged code. Could you suggest a good source on what needs to be done to grant those privileges? My google-fu has failed me.

    thanks!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s