File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ #!/usr/bin/env python
2+ #
3+ # This work is licensed under the GNU GPLv2 or later.
4+ # See the COPYING file in the top-level directory.
5+
6+ # getbug_restapi.py:
7+ # Simple demonstration of connecting to bugzilla over the REST
8+ # API and printing some bug details.
9+
10+ from __future__ import print_function
11+
12+ import bugzilla
13+
14+ # public test instance of bugzilla.redhat.com. It's okay to make changes
15+ URL = "partner-bugzilla.redhat.com"
16+
17+ # By default, if plain Bugzilla(URL) is invoked, the Bugzilla class will
18+ # attempt to determine if XMLRPC or REST API is available, with a preference
19+ # for XMLRPC for back compatability. But you can for use for the REST API
20+ # with force_rest=True
21+ bzapi = bugzilla .Bugzilla (URL , force_rest = True )
22+
23+ # After that, the bugzilla API can be used as normal. See getbug.py for
24+ # some more info here.
25+ bug = bzapi .getbug (427301 )
26+ print ("Fetched bug #%s:" % bug .id )
27+ print (" Product = %s" % bug .product )
28+ print (" Component = %s" % bug .component )
29+ print (" Status = %s" % bug .status )
30+ print (" Resolution= %s" % bug .resolution )
31+ print (" Summary = %s" % bug .summary )
You can’t perform that action at this time.
0 commit comments