Sophie

Sophie

distrib > Mageia > 7 > i586 > by-pkgid > 4e237fd705495e1e21ef20696443e053 > files > 968

bugzilla-5.0.4-3.mga7.noarch.rpm


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>6.1.12. Products &#8212; Bugzilla 5.0.4 documentation</title>
    <link rel="stylesheet" href="../../../_static/bugzilla.css" type="text/css" />
    <link rel="stylesheet" href="../../../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../../../',
        VERSION:     '5.0.4',
        COLLAPSE_INDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true,
        SOURCELINK_SUFFIX: '.txt'
      };
    </script>
    <script type="text/javascript" src="../../../_static/jquery.js"></script>
    <script type="text/javascript" src="../../../_static/underscore.js"></script>
    <script type="text/javascript" src="../../../_static/doctools.js"></script>
    <link rel="shortcut icon" href="../../../_static/favicon.ico"/>
    <link rel="search" title="Search" href="../../../search.html" />
    <link rel="next" title="6.1.13. Users" href="user.html" />
    <link rel="prev" title="6.1.11. Groups" href="group.html" /> 
  </head>
  <body>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="user.html" title="6.1.13. Users"
             accesskey="N">next</a></li>
        <li class="right" >
          <a href="group.html" title="6.1.11. Groups"
             accesskey="P">previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../../index.html">Bugzilla 5.0.4 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../../index.html" >6. WebService API Reference</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="index.html" accesskey="U">6.1. Core API v1</a> &#187;</li> 
      </ul>
    </div>  

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body" role="main">
            
  <div class="section" id="products">
<h1>6.1.12. Products<a class="headerlink" href="#products" title="Permalink to this headline">¶</a></h1>
<p>This part of the Bugzilla API allows you to list the available products and
get information about them.</p>
<div class="section" id="list-products">
<span id="rest-product-list"></span><h2>6.1.12.1. List Products<a class="headerlink" href="#list-products" title="Permalink to this headline">¶</a></h2>
<p>Returns a list of the IDs of the products the user can search on.</p>
<p><strong>Request</strong></p>
<p>To get a list of product IDs a user can select such as for querying bugs:</p>
<div class="highlight-text"><div class="highlight"><pre><span></span>GET /rest/product_selectable
</pre></div>
</div>
<p>To get a list of product IDs a user can enter a bug against:</p>
<div class="highlight-text"><div class="highlight"><pre><span></span>GET /rest/product_enterable
</pre></div>
</div>
<p>To get a list of product IDs a user can search or enter bugs against.</p>
<div class="highlight-text"><div class="highlight"><pre><span></span>GET /rest/product_accessible
</pre></div>
</div>
<p><strong>Response</strong></p>
<div class="highlight-js"><div class="highlight"><pre><span></span><span class="p">{</span>
  <span class="s2">&quot;ids&quot;</span><span class="o">:</span> <span class="p">[</span>
    <span class="s2">&quot;2&quot;</span><span class="p">,</span>
    <span class="s2">&quot;3&quot;</span><span class="p">,</span>
    <span class="s2">&quot;19&quot;</span><span class="p">,</span>
    <span class="s2">&quot;1&quot;</span><span class="p">,</span>
    <span class="s2">&quot;4&quot;</span>
  <span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
<table border="1" class="docutils">
<colgroup>
<col width="9%" />
<col width="11%" />
<col width="81%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">name</th>
<th class="head">type</th>
<th class="head">description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>ids</td>
<td>array</td>
<td>List of integer product IDs.</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="get-product">
<span id="rest-product-get"></span><h2>6.1.12.2. Get Product<a class="headerlink" href="#get-product" title="Permalink to this headline">¶</a></h2>
<p>Returns a list of information about the products passed to it.</p>
<p><strong>Request</strong></p>
<p>To return information about a specific type of products such as
<code class="docutils literal"><span class="pre">accessible</span></code>, <code class="docutils literal"><span class="pre">selectable</span></code>, or <code class="docutils literal"><span class="pre">enterable</span></code>:</p>
<div class="highlight-text"><div class="highlight"><pre><span></span>GET /rest/product?type=accessible
</pre></div>
</div>
<p>To return information about a specific product by <code class="docutils literal"><span class="pre">id</span></code> or <code class="docutils literal"><span class="pre">name</span></code>:</p>
<div class="highlight-text"><div class="highlight"><pre><span></span>GET /rest/product/(id_or_name)
</pre></div>
</div>
<p>You can also return information about more than one product by using the
following parameters in your query string:</p>
<div class="highlight-text"><div class="highlight"><pre><span></span>GET /rest/product?ids=1&amp;ids=2&amp;ids=3
GET /rest/product?names=ProductOne&amp;names=Product2
</pre></div>
</div>
<table border="1" class="docutils">
<colgroup>
<col width="13%" />
<col width="8%" />
<col width="79%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">name</th>
<th class="head">type</th>
<th class="head">description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>id_or_name</td>
<td>mixed</td>
<td>Integer product ID or product name.</td>
</tr>
<tr class="row-odd"><td>ids</td>
<td>array</td>
<td>Product IDs</td>
</tr>
<tr class="row-even"><td>names</td>
<td>array</td>
<td>Product names</td>
</tr>
<tr class="row-odd"><td>type</td>
<td>string</td>
<td>The group of products to return. Valid values are
<code class="docutils literal"><span class="pre">accessible</span></code> (default), <code class="docutils literal"><span class="pre">selectable</span></code>, and <code class="docutils literal"><span class="pre">enterable</span></code>.
<code class="docutils literal"><span class="pre">type</span></code> can be a single value or an array of values if more
than one group is needed with duplicates removed.</td>
</tr>
</tbody>
</table>
<p><strong>Response</strong></p>
<div class="highlight-js"><div class="highlight"><pre><span></span><span class="p">{</span>
  <span class="s2">&quot;products&quot;</span><span class="o">:</span> <span class="p">[</span>
    <span class="p">{</span>
      <span class="s2">&quot;id&quot;</span><span class="o">:</span> <span class="mi">1</span><span class="p">,</span>
      <span class="s2">&quot;default_milestone&quot;</span><span class="o">:</span> <span class="s2">&quot;---&quot;</span><span class="p">,</span>
      <span class="s2">&quot;components&quot;</span><span class="o">:</span> <span class="p">[</span>
        <span class="p">{</span>
          <span class="s2">&quot;is_active&quot;</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
          <span class="s2">&quot;default_assigned_to&quot;</span><span class="o">:</span> <span class="s2">&quot;admin@bugzilla.org&quot;</span><span class="p">,</span>
          <span class="s2">&quot;id&quot;</span><span class="o">:</span> <span class="mi">1</span><span class="p">,</span>
          <span class="s2">&quot;sort_key&quot;</span><span class="o">:</span> <span class="mi">0</span><span class="p">,</span>
          <span class="s2">&quot;name&quot;</span><span class="o">:</span> <span class="s2">&quot;TestComponent&quot;</span><span class="p">,</span>
          <span class="s2">&quot;flag_types&quot;</span><span class="o">:</span> <span class="p">{</span>
            <span class="s2">&quot;bug&quot;</span><span class="o">:</span> <span class="p">[</span>
              <span class="p">{</span>
                <span class="s2">&quot;is_active&quot;</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
                <span class="s2">&quot;grant_group&quot;</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
                <span class="s2">&quot;cc_list&quot;</span><span class="o">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
                <span class="s2">&quot;is_requestable&quot;</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
                <span class="s2">&quot;id&quot;</span><span class="o">:</span> <span class="mi">3</span><span class="p">,</span>
                <span class="s2">&quot;is_multiplicable&quot;</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
                <span class="s2">&quot;name&quot;</span><span class="o">:</span> <span class="s2">&quot;needinfo&quot;</span><span class="p">,</span>
                <span class="s2">&quot;request_group&quot;</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
                <span class="s2">&quot;is_requesteeble&quot;</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
                <span class="s2">&quot;sort_key&quot;</span><span class="o">:</span> <span class="mi">0</span><span class="p">,</span>
                <span class="s2">&quot;description&quot;</span><span class="o">:</span> <span class="s2">&quot;needinfo&quot;</span>
              <span class="p">}</span>
            <span class="p">],</span>
            <span class="s2">&quot;attachment&quot;</span><span class="o">:</span> <span class="p">[</span>
              <span class="p">{</span>
                <span class="s2">&quot;description&quot;</span><span class="o">:</span> <span class="s2">&quot;Review&quot;</span><span class="p">,</span>
                <span class="s2">&quot;is_multiplicable&quot;</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
                <span class="s2">&quot;name&quot;</span><span class="o">:</span> <span class="s2">&quot;review&quot;</span><span class="p">,</span>
                <span class="s2">&quot;is_requesteeble&quot;</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
                <span class="s2">&quot;request_group&quot;</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
                <span class="s2">&quot;sort_key&quot;</span><span class="o">:</span> <span class="mi">0</span><span class="p">,</span>
                <span class="s2">&quot;cc_list&quot;</span><span class="o">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
                <span class="s2">&quot;grant_group&quot;</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
                <span class="s2">&quot;is_requestable&quot;</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
                <span class="s2">&quot;id&quot;</span><span class="o">:</span> <span class="mi">2</span><span class="p">,</span>
                <span class="s2">&quot;is_active&quot;</span><span class="o">:</span> <span class="kc">true</span>
              <span class="p">}</span>
            <span class="p">]</span>
          <span class="p">},</span>
          <span class="s2">&quot;default_qa_contact&quot;</span><span class="o">:</span> <span class="s2">&quot;&quot;</span><span class="p">,</span>
          <span class="s2">&quot;description&quot;</span><span class="o">:</span> <span class="s2">&quot;This is a test component.&quot;</span>
        <span class="p">}</span>
      <span class="p">],</span>
      <span class="s2">&quot;is_active&quot;</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
      <span class="s2">&quot;classification&quot;</span><span class="o">:</span> <span class="s2">&quot;Unclassified&quot;</span><span class="p">,</span>
      <span class="s2">&quot;versions&quot;</span><span class="o">:</span> <span class="p">[</span>
        <span class="p">{</span>
          <span class="s2">&quot;id&quot;</span><span class="o">:</span> <span class="mi">1</span><span class="p">,</span>
          <span class="s2">&quot;name&quot;</span><span class="o">:</span> <span class="s2">&quot;unspecified&quot;</span><span class="p">,</span>
          <span class="s2">&quot;is_active&quot;</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
          <span class="s2">&quot;sort_key&quot;</span><span class="o">:</span> <span class="mi">0</span>
        <span class="p">}</span>
      <span class="p">],</span>
      <span class="s2">&quot;description&quot;</span><span class="o">:</span> <span class="s2">&quot;This is a test product.&quot;</span><span class="p">,</span>
      <span class="s2">&quot;has_unconfirmed&quot;</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
      <span class="s2">&quot;milestones&quot;</span><span class="o">:</span> <span class="p">[</span>
        <span class="p">{</span>
          <span class="s2">&quot;name&quot;</span><span class="o">:</span> <span class="s2">&quot;---&quot;</span><span class="p">,</span>
          <span class="s2">&quot;is_active&quot;</span><span class="o">:</span> <span class="kc">true</span><span class="p">,</span>
          <span class="s2">&quot;sort_key&quot;</span><span class="o">:</span> <span class="mi">0</span><span class="p">,</span>
          <span class="s2">&quot;id&quot;</span><span class="o">:</span> <span class="mi">1</span>
        <span class="p">}</span>
      <span class="p">],</span>
      <span class="s2">&quot;name&quot;</span><span class="o">:</span> <span class="s2">&quot;TestProduct&quot;</span>
    <span class="p">}</span>
  <span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
<p><code class="docutils literal"><span class="pre">products</span></code> (array) Each product object has the following items:</p>
<table border="1" class="docutils">
<colgroup>
<col width="22%" />
<col width="9%" />
<col width="69%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">name</th>
<th class="head">type</th>
<th class="head">description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>id</td>
<td>int</td>
<td>An integer ID uniquely identifying the product in
this installation only.</td>
</tr>
<tr class="row-odd"><td>name</td>
<td>string</td>
<td>The name of the product. This is a unique identifier
for the product.</td>
</tr>
<tr class="row-even"><td>description</td>
<td>string</td>
<td>A description of the product, which may contain HTML.</td>
</tr>
<tr class="row-odd"><td>is_active</td>
<td>boolean</td>
<td>A boolean indicating if the product is active.</td>
</tr>
<tr class="row-even"><td>default_milestone</td>
<td>string</td>
<td>The name of the default milestone for the product.</td>
</tr>
<tr class="row-odd"><td>has_unconfirmed</td>
<td>boolean</td>
<td>Indicates whether the UNCONFIRMED bug status is
available for this product.</td>
</tr>
<tr class="row-even"><td>classification</td>
<td>string</td>
<td>The classification name for the product.</td>
</tr>
<tr class="row-odd"><td>components</td>
<td>array</td>
<td>Each component object has the items described in the
Component object below.</td>
</tr>
<tr class="row-even"><td>versions</td>
<td>array</td>
<td>Each object describes a version, and has the
following items: <code class="docutils literal"><span class="pre">name</span></code>, <code class="docutils literal"><span class="pre">sort_key</span></code> and
<code class="docutils literal"><span class="pre">is_active</span></code>.</td>
</tr>
<tr class="row-odd"><td>milestones</td>
<td>array</td>
<td>Each object describes a milestone, and has the
following items: <code class="docutils literal"><span class="pre">name</span></code>, <code class="docutils literal"><span class="pre">sort_key</span></code> and
<code class="docutils literal"><span class="pre">is_active</span></code>.</td>
</tr>
</tbody>
</table>
<p>If the user tries to access a product that is not in the list of accessible
products for the user, or a product that does not exist, that is silently
ignored, and no information about that product is returned.</p>
<p>Component object:</p>
<table border="1" class="docutils">
<colgroup>
<col width="25%" />
<col width="9%" />
<col width="66%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">name</th>
<th class="head">type</th>
<th class="head">description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>id</td>
<td>int</td>
<td>An integer ID uniquely identifying the component in
this installation only.</td>
</tr>
<tr class="row-odd"><td>name</td>
<td>string</td>
<td>The name of the component.  This is a unique
identifier for this component.</td>
</tr>
<tr class="row-even"><td>description</td>
<td>string</td>
<td>A description of the component, which may contain
HTML.</td>
</tr>
<tr class="row-odd"><td>default_assigned_to</td>
<td>string</td>
<td>The login name of the user to whom new bugs
will be assigned by default.</td>
</tr>
<tr class="row-even"><td>default_qa_contact</td>
<td>string</td>
<td>The login name of the user who will be set as
the QA Contact for new bugs by default. Empty
string if the QA contact is not defined.</td>
</tr>
<tr class="row-odd"><td>sort_key</td>
<td>int</td>
<td>Components, when displayed in a list, are sorted
first by this integer and then secondly by their
name.</td>
</tr>
<tr class="row-even"><td>is_active</td>
<td>boolean</td>
<td>A boolean indicating if the component is active.
Inactive components are not enabled for new bugs.</td>
</tr>
<tr class="row-odd"><td>flag_types</td>
<td>object</td>
<td>An object containing two items <code class="docutils literal"><span class="pre">bug</span></code> and
<code class="docutils literal"><span class="pre">attachment</span></code> that each contains an array of
objects, where each describes a flagtype. The
flagtype items are described in the Flagtype
object below.</td>
</tr>
</tbody>
</table>
<p>Flagtype object:</p>
<table border="1" class="docutils">
<colgroup>
<col width="21%" />
<col width="9%" />
<col width="70%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">name</th>
<th class="head">type</th>
<th class="head">description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>id</td>
<td>int</td>
<td>Returns the ID of the flagtype.</td>
</tr>
<tr class="row-odd"><td>name</td>
<td>string</td>
<td>Returns the name of the flagtype.</td>
</tr>
<tr class="row-even"><td>description</td>
<td>string</td>
<td>Returns the description of the flagtype.</td>
</tr>
<tr class="row-odd"><td>cc_list</td>
<td>string</td>
<td>Returns the concatenated CC list for the flagtype, as
a single string.</td>
</tr>
<tr class="row-even"><td>sort_key</td>
<td>int</td>
<td>Returns the sortkey of the flagtype.</td>
</tr>
<tr class="row-odd"><td>is_active</td>
<td>boolean</td>
<td>Returns whether the flagtype is active or disabled.
Flags being in a disabled flagtype are not deleted.
It only prevents you from adding new flags to it.</td>
</tr>
<tr class="row-even"><td>is_requestable</td>
<td>boolean</td>
<td>Returns whether you can request for the given
flagtype (i.e. whether the '?' flag is available or
not).</td>
</tr>
<tr class="row-odd"><td>is_requesteeble</td>
<td>boolean</td>
<td>Returns whether you can ask someone specifically
or not.</td>
</tr>
<tr class="row-even"><td>is_multiplicable</td>
<td>boolean</td>
<td>Returns whether you can have more than one
flag for the given flagtype in a given bug/attachment.</td>
</tr>
<tr class="row-odd"><td>grant_group</td>
<td>int</td>
<td>the group ID that is allowed to grant/deny flags of
this type. If the item is not included all users are
allowed to grant/deny this flagtype.</td>
</tr>
<tr class="row-even"><td>request_group</td>
<td>int</td>
<td>The group ID that is allowed to request the flag if
the flag is of the type requestable. If the item is
not included all users are allowed request this
flagtype.</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="create-product">
<span id="rest-product-create"></span><h2>6.1.12.3. Create Product<a class="headerlink" href="#create-product" title="Permalink to this headline">¶</a></h2>
<p>This allows you to create a new product in Bugzilla.</p>
<p><strong>Request</strong></p>
<div class="highlight-text"><div class="highlight"><pre><span></span>POST /rest/product
</pre></div>
</div>
<div class="highlight-js"><div class="highlight"><pre><span></span><span class="p">{</span>
  <span class="s2">&quot;name&quot;</span> <span class="o">:</span> <span class="s2">&quot;AnotherProduct&quot;</span><span class="p">,</span>
  <span class="s2">&quot;description&quot;</span> <span class="o">:</span> <span class="s2">&quot;Another Product&quot;</span><span class="p">,</span>
  <span class="s2">&quot;classification&quot;</span> <span class="o">:</span> <span class="s2">&quot;Unclassified&quot;</span><span class="p">,</span>
  <span class="s2">&quot;is_open&quot;</span> <span class="o">:</span> <span class="kc">false</span><span class="p">,</span>
  <span class="s2">&quot;has_unconfirmed&quot;</span> <span class="o">:</span> <span class="kc">false</span><span class="p">,</span>
  <span class="s2">&quot;version&quot;</span> <span class="o">:</span> <span class="s2">&quot;unspecified&quot;</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Some params must be set, or an error will be thrown. The required params are
marked in bold.</p>
<table border="1" class="docutils">
<colgroup>
<col width="22%" />
<col width="9%" />
<col width="69%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">name</th>
<th class="head">type</th>
<th class="head">description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><strong>name</strong></td>
<td>string</td>
<td>The name of this product. Must be globally unique
within Bugzilla.</td>
</tr>
<tr class="row-odd"><td><strong>description</strong></td>
<td>string</td>
<td>A description for this product. Allows some simple
HTML.</td>
</tr>
<tr class="row-even"><td><strong>version</strong></td>
<td>string</td>
<td>The default version for this product.</td>
</tr>
<tr class="row-odd"><td>has_unconfirmed</td>
<td>boolean</td>
<td>Allow the UNCONFIRMED status to be set on bugs in
this product. Default: true.</td>
</tr>
<tr class="row-even"><td>classification</td>
<td>string</td>
<td>The name of the Classification which contains this
product.</td>
</tr>
<tr class="row-odd"><td>default_milestone</td>
<td>string</td>
<td>The default milestone for this product. Default
'---'.</td>
</tr>
<tr class="row-even"><td>is_open</td>
<td>boolean</td>
<td><code class="docutils literal"><span class="pre">true</span></code> if the product is currently allowing bugs
to be entered into it. Default: <code class="docutils literal"><span class="pre">true</span></code>.</td>
</tr>
<tr class="row-odd"><td>create_series</td>
<td>boolean</td>
<td><code class="docutils literal"><span class="pre">true</span></code> if you want series for New Charts to be
created for this new product. Default: <code class="docutils literal"><span class="pre">true</span></code>.</td>
</tr>
</tbody>
</table>
<p><strong>Response</strong></p>
<div class="highlight-js"><div class="highlight"><pre><span></span><span class="p">{</span>
  <span class="s2">&quot;id&quot;</span><span class="o">:</span> <span class="mi">20</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Returns an object with the following items:</p>
<table border="1" class="docutils">
<colgroup>
<col width="9%" />
<col width="9%" />
<col width="82%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">name</th>
<th class="head">type</th>
<th class="head">description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>id</td>
<td>int</td>
<td>ID of the newly-filed product.</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="update-product">
<span id="rest-product-update"></span><h2>6.1.12.4. Update Product<a class="headerlink" href="#update-product" title="Permalink to this headline">¶</a></h2>
<p>This allows you to update a product in Bugzilla.</p>
<p><strong>Request</strong></p>
<div class="highlight-text"><div class="highlight"><pre><span></span>PUT /rest/product/(id_or_name)
</pre></div>
</div>
<p>You can edit a single product by passing the ID or name of the product
in the URL. To edit more than one product, you can specify addition IDs or
product names using the <code class="docutils literal"><span class="pre">ids</span></code> or <code class="docutils literal"><span class="pre">names</span></code> parameters respectively.</p>
<div class="highlight-js"><div class="highlight"><pre><span></span><span class="p">{</span>
  <span class="s2">&quot;ids&quot;</span> <span class="o">:</span> <span class="p">[</span><span class="mi">123</span><span class="p">],</span>
  <span class="s2">&quot;name&quot;</span> <span class="o">:</span> <span class="s2">&quot;BarName&quot;</span><span class="p">,</span>
  <span class="s2">&quot;has_unconfirmed&quot;</span> <span class="o">:</span> <span class="kc">false</span>
<span class="p">}</span>
</pre></div>
</div>
<p>One of the below must be specified.</p>
<table border="1" class="docutils">
<colgroup>
<col width="18%" />
<col width="6%" />
<col width="75%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">name</th>
<th class="head">type</th>
<th class="head">description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td><strong>id_or_name</strong></td>
<td>mixed</td>
<td>Integer product ID or name.</td>
</tr>
<tr class="row-odd"><td><strong>ids</strong></td>
<td>array</td>
<td>Numeric IDs of the products that you wish to update.</td>
</tr>
<tr class="row-even"><td><strong>names</strong></td>
<td>array</td>
<td>Names of the products that you wish to update.</td>
</tr>
</tbody>
</table>
<p>The following parameters specify the new values you want to set for the product(s)
you are updating.</p>
<table border="1" class="docutils">
<colgroup>
<col width="22%" />
<col width="9%" />
<col width="69%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">name</th>
<th class="head">type</th>
<th class="head">description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>name</td>
<td>string</td>
<td>A new name for this product. If you try to set this
while updating more than one product, an error will
occur, as product names must be unique.</td>
</tr>
<tr class="row-odd"><td>default_milestone</td>
<td>string</td>
<td>When a new bug is filed, what milestone does it
get by default if the user does not choose one? Must
represent a milestone that is valid for this product.</td>
</tr>
<tr class="row-even"><td>description</td>
<td>string</td>
<td>Update the long description for these products to
this value.</td>
</tr>
<tr class="row-odd"><td>has_unconfirmed</td>
<td>boolean</td>
<td>Allow the UNCONFIRMED status to be set on bugs in
products.</td>
</tr>
<tr class="row-even"><td>is_open</td>
<td>boolean</td>
<td><code class="docutils literal"><span class="pre">true</span></code> if the product is currently allowing bugs
to be entered into it, <code class="docutils literal"><span class="pre">false</span></code> otherwise.</td>
</tr>
</tbody>
</table>
<p><strong>Response</strong></p>
<div class="highlight-js"><div class="highlight"><pre><span></span><span class="p">{</span>
   <span class="s2">&quot;products&quot;</span> <span class="o">:</span> <span class="p">[</span>
      <span class="p">{</span>
         <span class="s2">&quot;id&quot;</span> <span class="o">:</span> <span class="mi">123</span><span class="p">,</span>
         <span class="s2">&quot;changes&quot;</span> <span class="o">:</span> <span class="p">{</span>
            <span class="s2">&quot;name&quot;</span> <span class="o">:</span> <span class="p">{</span>
               <span class="s2">&quot;removed&quot;</span> <span class="o">:</span> <span class="s2">&quot;FooName&quot;</span><span class="p">,</span>
               <span class="s2">&quot;added&quot;</span> <span class="o">:</span> <span class="s2">&quot;BarName&quot;</span>
            <span class="p">},</span>
            <span class="s2">&quot;has_unconfirmed&quot;</span> <span class="o">:</span> <span class="p">{</span>
               <span class="s2">&quot;removed&quot;</span> <span class="o">:</span> <span class="s2">&quot;1&quot;</span><span class="p">,</span>
               <span class="s2">&quot;added&quot;</span> <span class="o">:</span> <span class="s2">&quot;0&quot;</span>
            <span class="p">}</span>
         <span class="p">}</span>
      <span class="p">}</span>
   <span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
<p><code class="docutils literal"><span class="pre">products</span></code> (array) Product change objects containing the following items:</p>
<table border="1" class="docutils">
<colgroup>
<col width="9%" />
<col width="8%" />
<col width="83%" />
</colgroup>
<thead valign="bottom">
<tr class="row-odd"><th class="head">name</th>
<th class="head">type</th>
<th class="head">description</th>
</tr>
</thead>
<tbody valign="top">
<tr class="row-even"><td>id</td>
<td>int</td>
<td>The ID of the product that was updated.</td>
</tr>
<tr class="row-odd"><td>changes</td>
<td>object</td>
<td><p class="first">The changes that were actually done on this product. The
keys are the names of the fields that were changed, and the
values are an object with two items:</p>
<ul class="last simple">
<li>added: (string) The value that this field was changed to.</li>
<li>removed: (string) The value that was previously set in this
field.</li>
</ul>
</td>
</tr>
</tbody>
</table>
<p>Booleans will be represented with the strings '1' and '0' for changed values
as they are stored as strings in the database currently.</p>
<hr class="docutils" />
<p>This documentation undoubtedly has bugs; if you find some, please file
them <a class="reference external" href="https://bugzilla.mozilla.org/enter_bug.cgi?product=Bugzilla&amp;component=Documentation">here</a>.</p>
</div>
</div>


          </div>
        </div>
      </div>
      <div class="sphinxsidebar" role="navigation" aria-label="main navigation">
        <div class="sphinxsidebarwrapper">
            <p class="logo"><a href="../../../index.html">
              <img class="logo" src="../../../_static/bugzilla.png" alt="Logo"/>
            </a></p>
  <h3><a href="../../../index.html">Table Of Contents</a></h3>
  <ul>
<li><a class="reference internal" href="#">6.1.12. Products</a><ul>
<li><a class="reference internal" href="#list-products">6.1.12.1. List Products</a></li>
<li><a class="reference internal" href="#get-product">6.1.12.2. Get Product</a></li>
<li><a class="reference internal" href="#create-product">6.1.12.3. Create Product</a></li>
<li><a class="reference internal" href="#update-product">6.1.12.4. Update Product</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="group.html"
                        title="previous chapter">6.1.11. Groups</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="user.html"
                        title="next chapter">6.1.13. Users</a></p>
<div id="searchbox" style="display: none" role="search">
  <h3>Quick search</h3>
    <form class="search" action="../../../search.html" method="get">
      <div><input type="text" name="q" /></div>
      <div><input type="submit" value="Go" /></div>
      <input type="hidden" name="check_keywords" value="yes" />
      <input type="hidden" name="area" value="default" />
    </form>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related" role="navigation" aria-label="related navigation">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="user.html" title="6.1.13. Users"
             >next</a></li>
        <li class="right" >
          <a href="group.html" title="6.1.11. Groups"
             >previous</a> |</li>
        <li class="nav-item nav-item-0"><a href="../../../index.html">Bugzilla 5.0.4 documentation</a> &#187;</li>
          <li class="nav-item nav-item-1"><a href="../../index.html" >6. WebService API Reference</a> &#187;</li>
          <li class="nav-item nav-item-2"><a href="index.html" >6.1. Core API v1</a> &#187;</li> 
      </ul>
    </div>
    <div class="footer" role="contentinfo">
      Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.6.6.
    </div>
  </body>
</html>