%META:TOPICINFO{author="TWikiContributor" date="1280723043" format="1.1" version="1"}%
%META:TOPICPARENT{name="TWikiPlugins"}%
---+!! <nop>%TOPIC%
<!--
   Contributions to this plugin are appreciated. Please update the plugin page at
   http://twiki.org/cgi-bin/view/Plugins/BugzillaQueryPlugin or provide feedback at
   http://twiki.org/cgi-bin/view/Plugins/BugzillaQueryPluginDev.
   If you are a TWiki contributor please update the plugin in the SVN repository.
-->
%SHORTDESCRIPTION%
<div style="float:right; background-color:#eeeeee; margin:0 0 20px 20px; padding: 0 10px 0 10px; width:380px">
%TOC{title="Page contents"}%
</div>

---++ Introduction

This plugin allows you to make links to Bugzilla or directly query Bugzilla for data and results could be formated. I take a vision from TWiki:Plugins.BugzillaLinkPlugin but it doesn't fulfill all needs of our company.

---++ Syntax Rules

   * =%<nop>BGQ{"12"}%=
   * =%<nop>BGQ{"12, 25, 200"}%=
   * =%<nop>BGQ{data="on" bug_status="NEW, ASSIGNED, REOPENED" product="xxx" target_milestone="yyy"}%=

---+++ Supported attributes

Attributes are named by columns in 'bugs' table in DB. It means you can use attributes "bug_id", "bug_status", "reporter", "target_milestone" etc. If you need to search by keywords then use attribute "keyword".

There are these 'special' attributes:
   * *data* - if set to "on" you get directly data from database
   * *format* - you can specify the output

---+++ Syntax and variables in 'format' attribute

You can use the same naming conventions as for attributes and put before it the character '$'.

Examples:
   * format="| $bug_id | $bug_status | $assigned_to |" 
| 123 | NEW | an_user@bugzilla.com |
| 234 | RESOLVED | another_user@bugzilla.com |
   * format="Bug $bug_id is in status $bug_status and was assigned to $assigned_to"  
Bug 123 is in status NEW and was assigned to an_user@bugzilla.com<br>
Bug 234 is in status RESOLVED and was assigned to another_user@bugzilla.com<br>

---++ Examples

   * %BGQ{"12"}%
   * %BGQ[bug_id="12"]%
   * %BGQ{"12, 25, 200"}%

%BGQ{data="on" bugstatus="NEW, ASSIGNED, REOPENED" product="xxx" milestone="yyy"}%

---++ <nop>%TOPIC% Settings

   * Set URL = https://marvin.in.idoox.com/bugzilla/
   * Set FORMAT = | $bug_id | $bug_severity | $priority | $bug_status | $resolution | $reporter | $product | $short_desc |
   * Set SHORTDESCRIPTION = Display links or data results from Bugzilla
   * Set SHOWBUGSCRIPT = show_bug.cgi
   * Set BUGLISTSCRIPT = buglist.cgi
   * Set BUGZILLA_DB_HOST =
   * Set BUGZILLA_DB_PORT = 
   * Set BUGZILLA_DB_NAME = bugs
   * Set BUGZILLA_USER = guest
   * Set BUGZILLA_PASSWD =
   * Set DEBUG = 0

---++ Plugin Installation Instructions

Extract <nop>BugzillaQueryPlugin.zip, edit the BugzillaQueryPlugin to your needs and have fun.

---++ Files

   * ==lib/TWiki/Plugins/BugzillaQueryPlugin.pm==
   * ==data/TWiki/BugzillaQueryPlugin.txt== 

---++ Plugin Info

|  Plugin Author: | TWiki:Main.RichardBaar |
|  Copyright: | &copy; 2004 TWiki:Main.RichardBaar, %BR% &copy; 2004-2010 TWiki:TWiki.TWikiContributor |
|  License: | GPL ([[http://www.gnu.org/copyleft/gpl.html][GNU General Public License]]) |
|  Plugin Version: | 19297 (2010-08-01) |
|  Change History: | <!-- versions below in reverse order -->&nbsp; |
|  2010-08-01: | TWikibug:Item6530 - doc fixes; changing TWIKIWEB to SYSTEMWEB |
|  23 Feb 2004: | Added keywords and remote machine support |
|  CPAN Dependencies: | DBI |
|  Other Dependencies: | none |
|  Perl Version: | 5.0 |
|  Plugin Home: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC% |
|  Feedback: | http://TWiki.org/cgi-bin/view/Plugins/%TOPIC%Dev |

__Related Topics:__ %SYSTEMWEB%.TWikiPreferences, %SYSTEMWEB%.TWikiPlugins
