Adding a New Field

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Adding a New Field

Raj11
Dear All,
We have a requirement to add a new field under description field in
bugzilla application when a new bug is logged. Can somebody please
help me with this.

Regards
Sandip
Reply | Threaded
Open this post in threaded view
|

Re: Adding a New Field

Unca Ghryswald
Raj11 wrote
Dear All,
We have a requirement to add a new field under description field in
bugzilla application when a new bug is logged. Can somebody please
help me with this.

Regards
Sandip
Hi Sandip,

I'm presuming you know how to actually CREATE the custom field, and that you are looking for a way to PLACE that field in a specific location in your template.

The template that presents the custom fields in the Create/Edit templates pushes them all together.

Example:
I have a customized a field: "Steps to Reproduce"
I do not want this displayed with the other 4 custom fields I have created, but below the Comments section.
So I interrupt the PROCESS call like this within the create/edit templates:
---
Basically - for every custom field EXCEPT "cf_steps_to_reproduce" call the template.

[% FOREACH field = Bugzilla.get_fields({ obsolete => 0, custom => 1, enter_bug => 1 }) %]
     [% SET value = ${field.name} IF ${field.name}.defined %]
     [% IF field.name != "cf_steps_to_reproduce" %]
          [% PROCESS bug/create_field.html.tmpl editable=1 value_span=0 %]
     [% END %]
[% END %]
---
Further down the page, where I DO want the cf_steps_to_reproduce to appear, I can duplicate the PROCESS call and change the "!=" to "==" but in my case, I want the cf_steps_to_reproduce field to be a textarea, so I force it to be a textarea through the textarea template rather than process the custom-fields template.
---
[% INCLUDE global/textarea.html.tmpl
         name = 'cf_steps_to_reproduce'
         id = 'cf_steps_to_reproduce'
         minrows = 12
         maxrows = 12
         cols = constants.COMMENT_COLS
         defaultcontent = defaultcontent
       %]
---

Hope this helps,
Unca Ghrys
Reply | Threaded
Open this post in threaded view
|

Re: Adding a New Field

Raj11
Thanks for your help.