3 issues relating to changing bugzilla version 3.4 create.html.tmpl in /var/www/bugzilla/template/en/default/bug/create
Hi,
I wonder if one of you can help me.
Issue #1: Result - Success
================
Lately I was successful in directly modifying file create.html.tmpl in /var/www/bugzilla/template/en/default/bug/create so that the bug description text box contains by default the paragraphs headline that should be included.
This is how I (somewhat primitively) did it:
...
<tr>
<th>Summary:</th>
<td colspan="3">
<input name="short_desc" size="70" value="[% short_desc FILTER html %]"
maxlength="255" spellcheck="true">
</td>
</tr>
<tr>
<th>Description:</th>
<td colspan="3">
[% defaultcontent = BLOCK %]
[% IF cloned_bug_id %]
+++ This [% terms.bug %] was initially created as a clone of [% terms.Bug %] #[% cloned_bug_id %] +++
[% END %]
[%-# We are within a BLOCK. The comment will be correctly HTML-escaped
# by global/textarea.html.tmpl. So we must not escape the comment here. %]
[% comment FILTER none %]
[%- END %]
[% INCLUDE global/textarea.html.tmpl
name = 'comment'
id = 'comment'
minrows = 10
maxrows = 25
cols = constants.COMMENT_COLS
defaultcontent = "General\n=======\n\n\nReproduction\n============\n\n\nExpected Result\n===============\n\n\nActual Result\n=============\n\n"
%]
<br>
</td>
....
Issue #2: Result - Success then failure
=======================
Excited with my success, I proceeded to creating a list of default CCs of my QA team, to be emailed each time a new bug is submitted, and only then.
This was a combination of changing email preferences in bugzilla UI and adding the following to the now infamous create.html.tmpl:
...
<tr>
<th>CC:</th>
<td colspan="2">
[% INCLUDE global/userselect.html.tmpl
name => cc
value => "h.m@kenshoo.com,a.t@kenshoo.com,rd.g@kenshoo.com,a.b@kenshoo.com,m.r@kenshoo.com,a.m@kenshoo.com,a.b@kenshoo.com"
size => 30
multiple => 10
%]
</td>
</tr>
...
Of course, I went through all my team's bugzilla accounts and only checked 'CC' in the following options:
- I'm added to or removed from this capacity
- A new bug is created
- The CC field changes
This worked for a while (the list of CC's actually appeared in the form) but then, with no warning, stopped working, meaning the QA team does not get a mail notification when someone submits a new bug.
Any idea what went wrong or how I can achieve this purpose in a more sophhisticated method?
Issue #3: Result - Lost in the dark
=====================
As you probably know, user defined fields only appear in the left column of the create bug page, with their order determined by 'Priority' number.
My team leader asked me a seemingly simple request: Can you put a new customized field, say, "Browser Version" so that it appears after last field in the right hand side of the page, to which more attention is devoted, as it contains important fields such as "Severity", "Priority".
Till now I was not successful in changing the template to achieve this.
Any magical Ideas how to do this? Can someone even send me a modified template I can learn from?
Thank you very much in advance,
Dekel Granit

Comments
Issue 1:
Your solution removes the cloned bug message and the comment that created by using saved template of the new bug, so i suggest to do it as following:
[% defaultcontent = BLOCK %]
[% IF cloned_bug_id %]
+++ This [% terms.bug %] was initially created as a clone of [% terms.Bug %] #[% cloned_bug_id %] +++
[% ELSE %]
General\n=======\n\n\nReproduction\n============\n\n\nExpected Result\n===============\n\n\nActual Result\n=============\n\n[% END %]
[%-# We are within a BLOCK. The comment will be correctly HTML-escaped
# by global/textarea.html.tmpl. So we must not escape the comment here. %]
[% comment FILTER none %]
[%- END %]
[% INCLUDE global/textarea.html.tmpl
name = 'comment'
id = 'comment'
minrows = 10
maxrows = 25
cols = constants.COMMENT_COLS
defaultcontent = defaultcontent
style = stylearg
%]
Another suggestion - keep the original template on its place, and add yours, customized ones to template/en/custom/bug/create. Bugzilla has mechanism for customized templates. After you add a new file, you have to run checksetup.pl (it will create the new template under data/template)
Issue 2
I think this solution is problematic because:
1. You have hard-coded list in the template, that needs to be changed every time people come/leave QA team - you can use Default CC feature instead ( defined by Component)
2. By changing users' email preferences you actually prevent them from getting some maybe relevant mails, and you have to change these preferences to each new user.
I suggest using Whining feature for this case instead - define a shared search for new bugs created today and define a whining event that will send the update with this search result to relevant people, let's say every day at noon.
Issue 3:
Custom fields in Bugzilla is a global feature, means all custom fields appear in one block in create/edit templates. Moving the whole block to another place is easy, but if you want to put only one or several fields to another place on the page, you need to do it hard-coded and remember to exclude it from the general custom fields block.
Example on how to show custom field cf_xxx:
[% field = Bugzilla.get_custom_system_field('cf_xxx') %]
[% IF field %]
[% SET value = cf_module.defined ? $cf_module : "" %]
[% INCLUDE bug/field.html.tmpl
bug = default, field = field, value = value, editable = 1,
value_span = 3 %]
[% END %]
And then to exclude it in global call:
[% FOREACH field = Bugzilla.active_custom_fields %]
[% NEXT UNLESS field.enter_bug && field.name != "cf_xxx" %]
[% SET value = ${field.name}.defined ? ${field.name} : "" %]
[% INCLUDE bug/field.html.tmpl
bug = default, field = field, value = value, editable = 1,
value_span = 3 %]
[% END %]
Hope this is helpful :)