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
These options are shared by some combination of the 'new', 'query', and 'modify' sub commands. Not every option works for each command though.
These options are shared by several commands, for tweaking the text output of the command results.
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.
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.
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.
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 --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 |