Sophie

Sophie

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

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.7. Comments &#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.8. Components" href="component.html" />
    <link rel="prev" title="6.1.6. Classifications" href="classification.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="component.html" title="6.1.8. Components"
             accesskey="N">next</a></li>
        <li class="right" >
          <a href="classification.html" title="6.1.6. Classifications"
             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="comments">
<h1>6.1.7. Comments<a class="headerlink" href="#comments" title="Permalink to this headline">¶</a></h1>
<div class="section" id="get-comments">
<span id="rest-comments"></span><h2>6.1.7.1. Get Comments<a class="headerlink" href="#get-comments" title="Permalink to this headline">¶</a></h2>
<p>This allows you to get data about comments, given a bug ID or comment ID.</p>
<p><strong>Request</strong></p>
<p>To get all comments for a particular bug using the bug ID or alias:</p>
<div class="highlight-text"><div class="highlight"><pre><span></span>GET /rest/bug/(id_or_alias)/comment
</pre></div>
</div>
<p>To get a specific comment based on the comment ID:</p>
<div class="highlight-text"><div class="highlight"><pre><span></span>GET /rest/bug/comment/(comment_id)
</pre></div>
</div>
<table border="1" class="docutils">
<colgroup>
<col width="19%" />
<col width="10%" />
<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><strong>id_or_alias</strong></td>
<td>mixed</td>
<td>A single integer bug ID or alias.</td>
</tr>
<tr class="row-odd"><td><strong>comment_id</strong></td>
<td>int</td>
<td>A single integer comment ID.</td>
</tr>
<tr class="row-even"><td>new_since</td>
<td>datetime</td>
<td>If specified, the method will only return comments
<em>newer</em> than this time. This only affects comments
returned from the <code class="docutils literal"><span class="pre">ids</span></code> argument. You will always be
returned all comments you request in the
<code class="docutils literal"><span class="pre">comment_ids</span></code> argument, even if they are older than
this date.</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;bugs&quot;</span><span class="o">:</span> <span class="p">{</span>
    <span class="s2">&quot;35&quot;</span><span class="o">:</span> <span class="p">{</span>
      <span class="s2">&quot;comments&quot;</span><span class="o">:</span> <span class="p">[</span>
        <span class="p">{</span>
          <span class="s2">&quot;time&quot;</span><span class="o">:</span> <span class="s2">&quot;2000-07-25T13:50:04Z&quot;</span><span class="p">,</span>
          <span class="s2">&quot;text&quot;</span><span class="o">:</span> <span class="s2">&quot;test bug to fix problem in removing from cc list.&quot;</span><span class="p">,</span>
          <span class="s2">&quot;bug_id&quot;</span><span class="o">:</span> <span class="mi">35</span><span class="p">,</span>
          <span class="s2">&quot;count&quot;</span><span class="o">:</span> <span class="mi">0</span><span class="p">,</span>
          <span class="s2">&quot;attachment_id&quot;</span><span class="o">:</span> <span class="kc">null</span><span class="p">,</span>
          <span class="s2">&quot;is_private&quot;</span><span class="o">:</span> <span class="kc">false</span><span class="p">,</span>
          <span class="s2">&quot;tags&quot;</span><span class="o">:</span> <span class="p">[],</span>
          <span class="s2">&quot;creator&quot;</span><span class="o">:</span> <span class="s2">&quot;user@bugzilla.org&quot;</span><span class="p">,</span>
          <span class="s2">&quot;creation_time&quot;</span><span class="o">:</span> <span class="s2">&quot;2000-07-25T13:50:04Z&quot;</span><span class="p">,</span>
          <span class="s2">&quot;id&quot;</span><span class="o">:</span> <span class="mi">75</span>
        <span class="p">}</span>
      <span class="p">]</span>
    <span class="p">}</span>
  <span class="p">},</span>
  <span class="s2">&quot;comments&quot;</span><span class="o">:</span> <span class="p">{}</span>
<span class="p">}</span>
</pre></div>
</div>
<p>Two items are returned:</p>
<p><code class="docutils literal"><span class="pre">bugs</span></code> This is used for bugs specified in <code class="docutils literal"><span class="pre">ids</span></code>. This is an object,
where the keys are the numeric IDs of the bugs, and the value is
a object with a single key, <code class="docutils literal"><span class="pre">comments</span></code>, which is an array of comments.
(The format of comments is described below.)</p>
<p>Any individual bug will only be returned once, so if you specify an ID
multiple times in <code class="docutils literal"><span class="pre">ids</span></code>, it will still only be returned once.</p>
<p><code class="docutils literal"><span class="pre">comments</span></code> Each individual comment requested in <code class="docutils literal"><span class="pre">comment_ids</span></code> is
returned here, in a object where the numeric comment ID is the key,
and the value is the comment. (The format of comments is described below.)</p>
<p>A &quot;comment&quot; as described above is a object that contains the following items:</p>
<table border="1" class="docutils">
<colgroup>
<col width="17%" />
<col width="10%" />
<col width="73%" />
</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 globally unique ID for the comment.</td>
</tr>
<tr class="row-odd"><td>bug_id</td>
<td>int</td>
<td>The ID of the bug that this comment is on.</td>
</tr>
<tr class="row-even"><td>attachment_id</td>
<td>int</td>
<td>If the comment was made on an attachment, this will be
the ID of that attachment. Otherwise it will be null.</td>
</tr>
<tr class="row-odd"><td>count</td>
<td>int</td>
<td>The number of the comment local to the bug. The
Description is 0, comments start with 1.</td>
</tr>
<tr class="row-even"><td>text</td>
<td>string</td>
<td>The actual text of the comment.</td>
</tr>
<tr class="row-odd"><td>creator</td>
<td>string</td>
<td>The login name of the comment's author.</td>
</tr>
<tr class="row-even"><td>time</td>
<td>datetime</td>
<td>The time (in Bugzilla's timezone) that the comment was
added.</td>
</tr>
<tr class="row-odd"><td>creation_time</td>
<td>datetime</td>
<td><p class="first">This is exactly same as the <code class="docutils literal"><span class="pre">time</span></code> key. Use this
field instead of <code class="docutils literal"><span class="pre">time</span></code> for consistency with other
methods including <a class="reference internal" href="bug.html#rest-single-bug"><span class="std std-ref">Get Bug</span></a> and
<a class="reference internal" href="attachment.html#rest-attachments"><span class="std std-ref">Get Attachment</span></a>.</p>
<p class="last">For compatibility, <code class="docutils literal"><span class="pre">time</span></code> is still usable. However,
please note that <code class="docutils literal"><span class="pre">time</span></code> may be deprecated and removed
in a future release.</p>
</td>
</tr>
<tr class="row-even"><td>is_private</td>
<td>boolean</td>
<td><code class="docutils literal"><span class="pre">true</span></code> if this comment is private (only visible to a
certain group called the &quot;insidergroup&quot;), <code class="docutils literal"><span class="pre">false</span></code>
otherwise.</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="create-comments">
<span id="rest-add-comment"></span><h2>6.1.7.2. Create Comments<a class="headerlink" href="#create-comments" title="Permalink to this headline">¶</a></h2>
<p>This allows you to add a comment to a bug in Bugzilla.</p>
<p><strong>Request</strong></p>
<p>To create a comment on a current bug.</p>
<div class="highlight-text"><div class="highlight"><pre><span></span>POST /rest/bug/(id)/comment
</pre></div>
</div>
<div class="highlight-js"><div class="highlight"><pre><span></span><span class="p">{</span>
  <span class="s2">&quot;comment&quot;</span> <span class="o">:</span> <span class="s2">&quot;This is an additional comment&quot;</span><span class="p">,</span>
  <span class="s2">&quot;is_private&quot;</span> <span class="o">:</span> <span class="kc">false</span>
<span class="p">}</span>
</pre></div>
</div>
<table border="1" class="docutils">
<colgroup>
<col width="14%" />
<col width="9%" />
<col width="77%" />
</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</strong></td>
<td>int</td>
<td>The ID or alias of the bug to append a comment to.</td>
</tr>
<tr class="row-odd"><td><strong>comment</strong></td>
<td>string</td>
<td>The comment to append to the bug. If this is empty
or all whitespace, an error will be thrown saying that you
did not set the <code class="docutils literal"><span class="pre">comment</span></code> parameter.</td>
</tr>
<tr class="row-even"><td>is_private</td>
<td>boolean</td>
<td>If set to true, the comment is private, otherwise it is
assumed to be public.</td>
</tr>
<tr class="row-odd"><td>work_time</td>
<td>double</td>
<td>Adds this many hours to the &quot;Hours Worked&quot; on the bug.
If you are not in the time tracking group, this value will
be ignored.</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">789</span>
<span class="p">}</span>
</pre></div>
</div>
<table border="1" class="docutils">
<colgroup>
<col width="10%" />
<col width="10%" />
<col width="80%" />
</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-created comment.</td>
</tr>
</tbody>
</table>
</div>
<div class="section" id="search-comment-tags">
<span id="rest-search-comment-tags"></span><h2>6.1.7.3. Search Comment Tags<a class="headerlink" href="#search-comment-tags" title="Permalink to this headline">¶</a></h2>
<p>Searches for tags which contain the provided substring.</p>
<p><strong>Request</strong></p>
<p>To search for comment tags:</p>
<div class="highlight-text"><div class="highlight"><pre><span></span>GET /rest/bug/comment/tags/(query)
</pre></div>
</div>
<p>Example:</p>
<div class="highlight-text"><div class="highlight"><pre><span></span>GET /rest/bug/comment/tags/spa
</pre></div>
</div>
<table border="1" class="docutils">
<colgroup>
<col width="13%" />
<col width="9%" />
<col width="78%" />
</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>query</strong></td>
<td>string</td>
<td>Only tags containg this substring will be returned.</td>
</tr>
<tr class="row-odd"><td>limit</td>
<td>int</td>
<td>If provided will return no more than <code class="docutils literal"><span class="pre">limit</span></code> tags.
Defaults to <code class="docutils literal"><span class="pre">10</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;spam&quot;</span>
<span class="p">]</span>
</pre></div>
</div>
<p>An array of matching tags.</p>
</div>
<div class="section" id="update-comment-tags">
<span id="rest-update-comment-tags"></span><h2>6.1.7.4. Update Comment Tags<a class="headerlink" href="#update-comment-tags" title="Permalink to this headline">¶</a></h2>
<p>Adds or removes tags from a comment.</p>
<p><strong>Request</strong></p>
<p>To update the tags comments attached to a comment:</p>
<div class="highlight-text"><div class="highlight"><pre><span></span>PUT /rest/bug/comment/(comment_id)/tags
</pre></div>
</div>
<p>Example:</p>
<div class="highlight-js"><div class="highlight"><pre><span></span><span class="p">{</span>
  <span class="s2">&quot;comment_id&quot;</span> <span class="o">:</span> <span class="mi">75</span><span class="p">,</span>
  <span class="s2">&quot;add&quot;</span> <span class="o">:</span> <span class="p">[</span><span class="s2">&quot;spam&quot;</span><span class="p">,</span> <span class="s2">&quot;bad&quot;</span><span class="p">]</span>
<span class="p">}</span>
</pre></div>
</div>
<table border="1" class="docutils">
<colgroup>
<col width="25%" />
<col width="9%" />
<col width="65%" />
</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>comment_id</strong></td>
<td>int</td>
<td>The ID of the comment to update.</td>
</tr>
<tr class="row-odd"><td>add</td>
<td>array</td>
<td>The tags to attach to the comment.</td>
</tr>
<tr class="row-even"><td>remove</td>
<td>array</td>
<td>The tags to detach from the comment.</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;bad&quot;</span><span class="p">,</span>
  <span class="s2">&quot;spam&quot;</span>
<span class="p">]</span>
</pre></div>
</div>
<p>An array of strings containing the comment's updated tags.</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.7. Comments</a><ul>
<li><a class="reference internal" href="#get-comments">6.1.7.1. Get Comments</a></li>
<li><a class="reference internal" href="#create-comments">6.1.7.2. Create Comments</a></li>
<li><a class="reference internal" href="#search-comment-tags">6.1.7.3. Search Comment Tags</a></li>
<li><a class="reference internal" href="#update-comment-tags">6.1.7.4. Update Comment Tags</a></li>
</ul>
</li>
</ul>

  <h4>Previous topic</h4>
  <p class="topless"><a href="classification.html"
                        title="previous chapter">6.1.6. Classifications</a></p>
  <h4>Next topic</h4>
  <p class="topless"><a href="component.html"
                        title="next chapter">6.1.8. Components</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="component.html" title="6.1.8. Components"
             >next</a></li>
        <li class="right" >
          <a href="classification.html" title="6.1.6. Classifications"
             >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>