Welcome to Bugsy!¶
Bugsy is a tool that allows you to programmatically work with Bugzilla using its native REST API.
To use you will do
import bugsy bugzilla = bugsy.Bugsy() bug = bugzilla.get(123456) bug123456.status = 'RESOLVED' bug123456.resolution = 'FIXED' bugzilla.put(bug123456)
To install Bugsy, simply use pip or easy install
pip install bugsy
Getting a bug from Bugzilla¶
Getting a bug is quite simple. Create a Bugsy object and then get the bug number that you want.
import bugsy bugzilla = bugsy.Bugsy() bug = bugzilla.get(123456)
Creating a new bug¶
To create a new bug, create a Bug object, populate it with the items that you need and then use the Bugsy object to put the bug into Bugzilla
import bugsy bug = bugsy.Bug() bug.summary = "I really realy love cheese" bug.add_comment("and I really want sausages with it!") bugzilla = bugsy.Bugsy("username", "password") bugzilla.put(bug) bug.id #returns the bug id from Bugzilla
To search for bugs you will need to create a
Bugsy object and then you can call
search_for and chain the search. The
Search API is a Fluent API
o you just chain the items that you need and then call search when the search is complete.
import bugsy bugzilla = bugsy.Bugsy() bugs = bugzilla.search_for\ .keywords("checkin-needed")\ .include_fields("flags")\ .search()
More details can be found in from the