how to create new bug in bugzilla using python
Bugzilla version 5.0.2 and Python 2.7
following link says we can create: https://www.bugzilla.org/docs/4.4/en/html/api/Bugzilla/WebService/Bug.html#create
but i am looking for sample code
how to create new bug in bugzilla using python
Bugzilla version 5.0.2 and Python 2.7
following link says we can create: https://www.bugzilla.org/docs/4.4/en/html/api/Bugzilla/WebService/Bug.html#create
but i am looking for sample code
You could also try using python-bugzilla.
https://pypi.python.org/pypi/python-bugzilla/1.2.2
Here is sample code to get a bug.
import bugzilla
bz = bugzilla.Bugzilla(url="https://bugzilla.kernel.org")
print bz.getbug(1)
after long hunt i got solution ... wanted to share
need to install : easy_install bugsy
Here is Python code:
import bugsy
bugsyObj = bugsy.Bugsy(username="[email protected]", password="passwd23", userid=None, cookie=None, api_key=None, bugzilla_url='http://11.110.2.212/bugzilla/rest')
bug = bugsy.Bug()
bug.product="PRODUCT_REQUEST"
bug.component="Work for Windows"
bug.summary = "THIS IS JUST TEST FROM BUGSY"
bug.add_comment("THE COMMENT SECTION")
bug.assigned_to="[email protected]"
bugsyObj.put(bug)
bug.id
This will returns the bug id from Bugzilla. It required
A sample example written in python, to create a bug in Bugzilla 5.x, using the rest API .
import requests
data = {
"product" : "TestProduct",
"component" : "TestComponent",
"summary" : "This is the best bug report",
"version" : "unspecified",
"description" : "This is the best GUI for reporting bugs"
}
url_bz_restapi = 'http://localhost/bugzilla/rest.cgi/bug'
r = requests.post(url_bz_restapi, data=data)