DOKK / manpages / debian 10 / bugzilla-cli / bugzilla.1.en
bugzilla(1) User Commands bugzilla(1)

bugzilla - command-line interface to Bugzilla over XML-RPC

bugzilla [options] [command] [command-options]

bugzilla is a command-line utility that allows access to the XML-RPC interface provided by Bugzilla.

command is one of:
* login - log into the given bugzilla instance
* new - create a new bug
* query - search for bugs matching given criteria
* modify - modify existing bugs
* attach - attach files to existing bugs, or get attachments
* info - get info about the given bugzilla instance

show program's version number and exit
show this help message and exit
bugzilla XMLRPC URI. default: https://bugzilla.redhat.com/xmlrpc.cgi
Don't error on invalid bugzilla SSL certificate
client side certificate file needed by the webserver.
Run interactive "login" before performing the specified command.
Log in with this username
Log in with this password
Raise an error if we aren't logged in to bugzilla. Consider using this if you are depending on cached credentials, to ensure that when they expire the tool errors, rather than subtly change output.
Don't save any bugzilla cookies or tokens to disk, and don't use any pre-existing credentials.
cookie file to use for bugzilla authentication
token file to use for bugzilla authentication
give more info about what's going on
output bunches of debugging info
show program's version number and exit

These options are shared by some combination of the 'new', 'query', and 'modify' sub commands. Not every option works for each command though.

Product name
Product version
Component name
Bug summary
Set initial bug comment/description
Comment tag for the new comment
RHBZ sub component name
Operating system
Arch this bug occurs on
Bug severity
Bug priority
Bug alias (name)
Bug status (NEW, ASSIGNED, etc.)
URL for further bug info
Target milestone
RHBZ Target release
Bug IDs that this bug blocks
Bug IDs that this bug depends on
Bug keywords
Which user groups can view this bug
CC list
Bug assignee
QA contact
Set or unset a flag. For example, to set a flag named devel_ack, do --flag devel_ack+ Unset a flag with the 'X' value, like --flag needinfoX
Set (personal) tags field
Whiteboard field
RHBZ devel whiteboard field
RHBZ internal whiteboard field
RHBZ QA whiteboard field
RHBZ 'Fixed in version' field
Manually specify a bugzilla XMLRPC field. FIELD is the raw name used by the bugzilla instance. For example if your bugzilla instance has a custom field cf_my_field, do: --field cf_my_field=VALUE

These options are shared by several commands, for tweaking the text output of the command results.

output detailed bug info
output only bug IDs
output additional bug information (keywords, Whiteboards, etc.)
one line summary of the bug (useful for scripts)
raw output of the bugzilla contents
Print output in the form given. You can use RPM-style tags that match bug fields, e.g.: '%{id}: %{summary}'.

The output of the bugzilla tool should NEVER BE PARSED unless you are using a custom --outputformat. For everything else, just don't parse it, the formats are not stable and are subject to change.

--outputformat allows printing arbitrary bug data in a user preferred format. For example, to print a returned bug ID, component, and product, separated with ::, do:

--outputformat "%{id}::%{component}::%{product}"

The fields (like 'id', 'component', etc.) are the names of the values returned by bugzilla's XMLRPC interface. To see a list of all fields, check the API documentation in the 'SEE ALSO' section. Alternatively, run a 'bugzilla --debug query ...' and look at the key names returned in the query results. Also, in most cases, using the name of the associated command line switch should work, like --bug_status becomes %{bug_status}, etc.

‘query’ specific options

Certain options can accept a comma separated list to query multiple values, including --status, --component, --product, --version, --id.

Note: querying via explicit command line options will only get you so far. See the --from-url option for a way to use powerful Web UI queries from the command line.

specify individual bugs by IDs, separated with commas
Email: search reporter email for given address
Search using bugzilla's quicksearch functionality.
Name of a bugzilla saved search. If you don't own this saved search, you must passed --savedsearch_sharer_id.
Owner ID of the --savedsearch. You can get this ID from the URL bugzilla generates when running the saved search from the web UI.
Make a working query via bugzilla's 'Advanced search' web UI, grab the url from your browser (the string with query.cgi or buglist.cgi in it), and --from-url will run it via the bugzilla API. Don't forget to quote the string! This only works for Bugzilla 5 and Red Hat bugzilla

‘modify’ specific options

Fields that take multiple values have a special input format.


Append: --cc=foo@example.com
Overwrite: --cc==foo@example.com
Remove: --cc=-foo@example.com

Options that accept this format: --cc, --blocked, --dependson, --groups, --tags, whiteboard fields.

Close with the given resolution (WONTFIX, NOTABUG, etc.)
ID of original bug. Implies --close DUPLICATE
Mark new comment as private
Reset assignee to component default
Reset QA contact to component default

‘attach’ options

File to attach, or filename for data provided on stdin
A short description of the file being attached
Mime-type for the file being attached
Download the attachment with the given ID
Download all attachments on the given bug
Add comment with attachment

‘info’ options

Get a list of products
List the components in the given product
List components (and their owners)
List the versions for the given product
Only show active components. Combine with --components*

Older bugzilla instances use cookie-based authentication, and newer bugzilla instances (around 5.0) use a non-cookie token system.

When you log into bugzilla with the "login" subcommand or the "--login" argument, we cache the login credentials in ~/.cache/python-bugzilla/ Previously we cached credentials in ~/.<filename>. If you want to see which file the tool is using, check --debug output.

To perform an authenticated bugzilla command on a new machine, run a one time "bugzilla login" to cache credentials before running the desired command. You can also run "bugzilla --login" and the login process will be initiated before invoking the command.

Additionally, the --no-cache-credentials option will tell the bugzilla tool to _not_ save any credentials in $HOME, or use any previously cached credentials.

bugzilla query --bug_id 62037

bugzilla query --version 15 --component python-bugzilla

# All boolean options can be formatted like this
bugzilla query --blocked "123456 | 224466"

bugzilla login

bugzilla new -p Fedora -v rawhide -c python-bugzilla \
--summary "python-bugzilla causes headaches" \
--comment "python-bugzilla made my brain hurt when I used it."

bugzilla attach --file ~/Pictures/cam1.jpg --desc "me, in pain" $BUGID

bugzilla attach --getall $BUGID

bugzilla modify --close NOTABUG --comment "Actually, you're hungover." $BUGID

bugzilla normally returns 0 if the requested command was successful. Otherwise, exit status is 1 if bugzilla is interrupted by the user (or a login attempt fails), 2 if a socket error occurs (e.g. TCP connection timeout), and 3 if the server returns an XML-RPC fault.

Please report any bugs as github issues at
https://github.com/python-bugzilla/python-bugzilla
to the mailing list at
https://fedorahosted.org/mailman/listinfo/python-bugzilla

https://bugzilla.readthedocs.io/en/latest/api/index.html
https://bugzilla.redhat.com/docs/en/html/api/Bugzilla/WebService/Bug.html
March 30, 2017 version 2.1.0