You are here: CFCL Wiki>Help Web>WikiTut>WikiTutBugzilla (23 May 2011, vlb)Edit Attach

Bugzilla table include

Demo of how to use %INCLUDE% variables to grab an Bugzilla summary table and include it in a Wiki page, with a bit of CSS to make it pretty.

   * Bugzilla Preferences
      * Set BUGURL = http://bug.corp.company.com/
      * Set BUGQUERY = buglist.cgi?query_format=advanced
      * Set BUGCOL = columnlist=bug_id,priority,bug_severity,age,assigned_to_realname,bug_status,component,short_desc
      * Set BUGCOL = columnlist=bug_id,priority,bug_severity,age,assigned_to_realname,bug_status,short_desc,changeddate,dependson
      * Set BUGPRODUCT = product_name=yst-map-Relevance-Tests
      * Set BUGCOMPONENT = component=Intl-Scrape-Load-Judge-Report
      * Set BUGORDERBY = order=short_desc
      * Set BUGOPEN = bug_status=NEW&bug_status=ASSIGNED&bug_status=ACCEPTED&bug_status=REOPENED
      * Set BUGRESOLVED = bug_status=RESOLVED&bug_status=VERIFIED
      * Set BUGSUMMARY = short_desc_type=allwordssubstr&short_desc=2007+Q4+Competitive
      * Set BUGSUMMARYEXCLUDE = field0-0-0=short_desc&type0-0-0=nowordssubstr&value0-0-0=SBS
      * Set BUGCLOSED = bug_status=CLOSED
      * Set PRINTERFRIENDLY = printer_friendly=yes

Bug reports

Or just try this link: http://bug.corp.company.com/buglist.cgi?columnlist=bug_id,priority,bug_severity,age,assigned_to_realname,bug_status,short_desc,changeddate,dependson&product_name=yst-map-Relevance-Tests&component=Intl-Scrape-Load-Judge-Report&short_desc_type=allwordssubstr&short_desc=2007+Q4+Competitive&field0-0-0=short_desc&type0-0-0=nowordssubstr&value0-0-0=SBS&order=short_desc&printer_friendly=yes

Getting just the number of tickets returned by a query

You can use %INCLUDE% with the pattern parameter to look for the "Your search found NNN tickets." string:

   * Set BUG_COUNT = %INCLUDE{"http://bug.corp.company.com/buglist.cgi?%BUGCOL%&%BUGPRODUCT%&%BUGCOMPONENT%&%BUGSUMMARY%&%BUGSUMMARYEXCLUDE%&%BUGORDERBY%&%PRINTERFRIENDLY%" pattern="^.*Your search found <b>(\d+)<\/b> tickets.*"}%

Then use an IF statement for the special case of no tickets, when Bugzilla returns "No tickets found." instead of a consistent "Your search found 0 tickets.".

There are %IF{"'%BUG_COUNT%' = ''" then="no" else="%BUG_COUNT%"}% tickets.

There are IF{ "' Failed to include URL http://bug.corp.company.com/buglist.cgi?columnlist=bug_id,priority,bug_severity,age,assigned_to_realname,bug_status,short_desc,changeddate,dependson&product_name=yst-map-Relevance-Tests&component=Intl-Scrape-Load-Judge-Report&short_desc_type=allwordssubstr&short_desc=2007+Q4+Competitive&field0-0-0=short_desc&type0-0-0=nowordssubstr&value0-0-0=SBS&order=short_desc&printer_friendly=yes Can't connect to bug.corp.company.com:80 (Bad hostname) ' = ''" else=" Failed to include URL http://bug.corp.company.com/buglist.cgi?columnlist=bug_id,priority,bug_severity,age,assigned_to_realname,bug_status,short_desc,changeddate,dependson&product_name=yst-map-Relevance-Tests&component=Intl-Scrape-Load-Judge-Report&short_desc_type=allwordssubstr&short_desc=2007+Q4+Competitive&field0-0-0=short_desc&type0-0-0=nowordssubstr&value0-0-0=SBS&order=short_desc&printer_friendly=yes Can't connect to bug.corp.company.com:80 (Bad hostname) " then="no" }: Missing operator in '' Failed to include URL http://bug.corp.company.com/buglist.cgi?columnlist=bug_id,priority,bug_severity,age,assigned_to_realname,bug_status,short_desc,changeddate,dependson&product_name=yst-map-Relevance-Tests&component=Intl-Scrape-Load-Judge-Report&short_desc_type=allwordssubstr&short_desc=2007+Q4+Competitive&field0-0-0=short_desc&type0-0-0=nowordssubstr&value0-0-0=SBS&order=short_desc&printer_friendly=yes Can't connect to bug.corp.company.com:80 (Bad hostname) ' = ''' at ' ' = ''' tickets.

Topic revision: r7 - 23 May 2011, vlb
This site is powered by Foswiki Copyright © by the contributing authors. All material on this wiki is the property of the contributing authors.
Foswiki version v2.1.6, Release Foswiki-2.1.6, Plugin API version 2.4
Ideas, requests, problems regarding CFCL Wiki? Send us email