logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

bugzilla - command line tool for interacting with Bugzilla

Authentication Cache And Api Keys

       Some command usage will require an active login to the bugzilla instance. For example,  if  the  bugzilla
       instance  has  some  private  bugs,  those bugs will be missing from 'query' output if you do not have an
       active login.

       If you are connecting to a bugzilla 5.0 or later instance, the best option is to use bugzilla  API  keys.
       From  the  bugzilla  web  UI, log in, navigate to Preferences->API Keys, and generate a key (it will be a
       long string of characters and numbers).

       Then use 'bugzilla --bugzilla URL login --api-key', which will ask for  the  API  key,  and  save  it  to
       bugzillarc for you.

       For  older  bugzilla  instances,  you will need to cache a login token with the "login" subcommand or the
       "--login" argument.

       Additionally, the --no-cache-credentials option will tell the bugzilla  tool  to  not  save  or  use  any
       authentication cache, including the bugzillarc file.

Bugs

       Please report any bugs as github issues at https://github.com/python-bugzilla/python-bugzilla

Bugzillarc Config File

       Both  bugzilla and the python-bugzilla library will read a bugzillarc config file if it is present in the
       following locations:

       • /etc/bugzillarc

       • ~/.bugzillarc~/.config/python-bugzilla/bugzillarc

       The contents of the files are processed and merged together in the order they are listed above.

       The main usage for bugzillarc is to store API keys for your bugzilla URLs:

          [bugzilla.example.com]
          api_key=INSERT-YOUR-API-KEY-HERE

          [bugzilla.redhat.com]
          api_key=MY-REDHAT-API-KEY-BLAH

       The sections must be hostnames. Other values that can be set per hostname section are

       • user: default auth username

       • password: default auth password

       • cert: default client side certificate

       A [DEFAULTS] section is also accepted, which takes the following values:

       • url: default bugzilla URL

Description

bugzilla is a command line tool for interacting with a Bugzilla instance over REST or XMLRPC.

       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

Examples

       bugzilla query --bug_id 62037

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

       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

Exit Status

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 Bugzilla server throws an error.

Global Options

--help,-hSyntax:-h

       show this help message and exit

   --bugzillaSyntax:--bugzilla BUGZILLA

       The bugzilla URL. Full API URLs are typically like:

       * https://bugzilla.example.com/xmlrpc.cgi    # XMLRPC API
       * https://bugzilla.example.com/rest/         # REST API

       If  a  non-specific  URL  is  passed,  like 'bugzilla.redhat.com', bugzilla will try to probe whether the
       expected XMLRPC or REST path is available, preferring XMLRPC for backwards compatibility.

       The default URL https://bugzilla.redhat.com--nosslverifySyntax:--nosslverify

       Don't error on invalid bugzilla SSL certificate

   --certSyntax:--cert CERTFILE

       client side certificate file needed by the webserver.

   --loginSyntax:--login

       Run interactive "login" before performing the specified command.

   --usernameSyntax:--username USERNAME

       Log in with this username

   --passwordSyntax:--password PASSWORD

       Log in with this password

   --restrict-loginSyntax:--restrict-login

       The session (login token) will be restricted to the current IP address.

   --ensure-logged-inSyntax:--ensure-logged-in

       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.

   --no-cache-credentialsSyntax:--no-cache-credentials

       Don't save any bugzilla tokens to disk, and don't use any pre-existing credentials.

   --tokenfileSyntax:--tokenfile TOKENFILE

       token file to use for bugzilla authentication

   --verboseSyntax:--verbose

       give more info about what's going on

   --debugSyntax:--debug

       output bunches of debugging info

   --versionSyntax:--version

       show program's version number and exit

Name

       bugzilla - command line tool for interacting with Bugzilla

Output Options

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

   --fullSyntax:--full

       output detailed bug info

   -i,--idsSyntax:--ids

       output only bug IDs

   -e,--extraSyntax:--extra

       output additional bug information (keywords, Whiteboards, etc.)

   --onelineSyntax:--oneline

       one line summary of the bug (useful for scripts)

   --jsonSyntax:--json

       output bug contents in JSON format

   --includefieldSyntax:--includefield

       Pass  the  field  name  to  bugzilla  include_fields  list.  Only the fields passed to include_fields are
       returned by the bugzilla server.  This can be specified multiple times.

   --extrafieldSyntax:--extrafield

       Pass the field name to bugzilla extra_fields list.  When used with --json this can  be  used  to  request
       bugzilla to return values for non-default fields.  This can be specified multiple times.

   --excludefieldSyntax:--excludefield

       Pass  the  field name to bugzilla exclude_fields list.  When used with --json this can be used to request
       bugzilla to not return values for a field.  This can be specified multiple times.

   --rawSyntax:--raw

       raw output of the bugzilla contents. This format is unstable and  difficult  to  parse.  Please  use  the
       --json instead if you want maximum output from the bugzilla--outputformatSyntax:--outputformat OUTPUTFORMAT

       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 API. 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.

See Also

https://bugzilla.readthedocs.io/en/latest/api/index.htmlhttps://bugzilla.redhat.com/docs/en/html/api/core/v1/bug.htmlBUGZILLA(1)

Standard Bugzilla Options

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

   -p,--productSyntax:--product PRODUCT

       Product name

   -v,--versionSyntax:--version VERSION

       Product version

   -c,--componentSyntax:--component COMPONENT

       Component name

   -s,--summarySyntax:--summary SUMMARY

       Bug summary

   -l,--commentSyntax:--comment DESCRIPTION

       Set initial bug comment/description

   --comment-tagSyntax:--comment-tag TAG

       Comment tag for the new comment

   --sub-componentSyntax:--sub-component SUB_COMPONENT

       RHBZ sub component name

   -o,--osSyntax:--os OS

       Operating system

   --archSyntax:--arch ARCH

       Arch this bug occurs on

   -x,--severitySyntax:--severity SEVERITY

       Bug severity

   -z,--prioritySyntax:--priority PRIORITY

       Bug priority

   --aliasSyntax:--alias ALIAS

       Bug alias (name)

   -s,--statusSyntax:--status STATUS

       Bug status (NEW, ASSIGNED, etc.)

   -u,--urlSyntax:--url URL

       URL for further bug info

   -m--target_milestoneSyntax:--target_milestone TARGET_MILESTONE

       Target milestone

   --target_releaseSyntax:--target_release TARGET_RELEASE

       RHBZ Target release

   --blockedSyntax:...]

       Bug IDs that this bug blocks

   --dependsonSyntax:...]

       Bug IDs that this bug depends on

   --keywordsSyntax:...]

       Bug keywords

   --groupsSyntax:...]

       Which user groups can view this bug

   --ccSyntax:...]

       CC list

   -a,--assignee,--assigned_toSyntax:--assigned_to ASSIGNED_TO

       Bug assignee

   -q,--qa_contactSyntax:--qa_contact QA_CONTACT

       QA contact

   -f,--flagSyntax:--flag FLAG

       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

   --tagsSyntax:--tags TAG

       Set (personal) tags field

   -w,--whiteboardSyntax:--whiteboard WHITEBOARD

       Whiteboard field

   --devel_whiteboardSyntax:--devel_whiteboard DEVEL_WHITEBOARD

       RHBZ devel whiteboard field

   --internal_whiteboardSyntax:--internal_whiteboard INTERNAL_WHITEBOARD

       RHBZ internal whiteboard field

   --qa_whiteboardSyntax:--qa_whiteboard QA_WHITEBOARD

       RHBZ QA whiteboard field

   -F,--fixed_inSyntax:--fixed_in FIXED_IN

       RHBZ 'Fixed in version' field

   --fieldSyntax:--field FIELD=VALUE

       Manually  specify  a bugzilla API 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

   --field-jsonSyntax:--field-json JSONSTRING

       Specify --field data as a JSON string. Example: --field-json '{"cf_my_field": "VALUE",  "cf_array_field":
       [1, 2]}'

Synopsis

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

‘Attach’ Options

-f,--fileSyntax:--file FILENAME

       File to attach, or filename for data provided on stdin

   -d,--descriptionSyntax:--description DESCRIPTION

       A short description of the file being attached

   -t,--typeSyntax:--type MIMETYPE

       Mime-type for the file being attached

   -g,--getSyntax:--get ATTACHID

       Download the attachment with the given ID

   --getallSyntax:--getall BUGID

       Download all attachments on the given bug

   --ignore-obsoleteSyntax:--ignore-obsolete

       Do not download attachments marked as obsolete.

   -l,--commentSyntax:--comment COMMENT

       Add comment with attachment

‘Info’ Options

-p,--productsSyntax:--products

       Get a list of products

   -c,--componentsSyntax:--components PRODUCT

       List the components in the given product

   -o,--component_ownersSyntax:--component_owners PRODUCT

       List components (and their owners)

   -v,--versionsSyntax:--versions PRODUCT

       List the versions for the given product

   --active-componentsSyntax:--active-components

       Only show active components. Combine with --components*

‘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.

   -k,--closeRESOLUTIONSyntax:RESOLUTION

       Close with the given resolution (WONTFIX, NOTABUG, etc.)

   -d,--dupeidSyntax:--dupeid ORIGINAL

       ID of original bug. Implies --close DUPLICATE

   --privateSyntax:--private

       Mark new comment as private

   --reset-assigneeSyntax:--reset-assignee

       Reset assignee to component default

   --reset-qa-contactSyntax:--reset-qa-contact

       Reset QA contact to component default

   --minor-updateSyntax:--minor-update

       Request bugzilla to not send any email about this change

‘New’ Specific Options

--privateSyntax:--private

       Mark new comment as private

‘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.

   -b,--bug_id,--idSyntax:--id ID

       specify individual bugs by IDs, separated with commas

   -r,--reporterSyntax:--reporter REPORTER

       Email: search reporter email for given address

   --quicksearchSyntax:--quicksearch QUICKSEARCH

       Search using bugzilla's quicksearch functionality.

   --savedsearchSyntax:--savedsearch SAVEDSEARCH

       Name  of  a  bugzilla  saved  search.  If  you  don't  own   this   saved   search,   you   must   passed
       --savedsearch_sharer_id.

   --savedsearch-sharer-idSyntax:--savedsearch-sharer-id 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.

   --from-urlSyntax:--from-url WEB_QUERY_URL

       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

See Also