0

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

4 Answers 4

1

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)
Sign up to request clarification or add additional context in comments.

Comments

0

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

1 Comment

This is giving me - ValueError: No JSON object could be decoded
0

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)

Comments

0
import os
while True:
    pass
    os.startfile(your file name)
  • your file name should be the name of you file and after that .py
  • if my file is named hi is should be this

os.startfile(hi.py)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.