Custom Field

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

Custom Field

Jack Sparrow
Hi Everyone,

I've created a custom field while creating Bug. This field should appear for certain users. How to make it possible?
Reply | Threaded
Open this post in threaded view
|

Re: Custom Field

Dave Miller
The criteria for when the field is displays is on the edit form when creating or editing the form.  Currently you can only control it based on the appearance of other fields on the bug, not by the user viewing it.

In Bugzilla 4.0 and newer there is an extension hook that can be used to control whether a custom field is displayed or not.  You could create an extension and use that hook to check the user's group membership and display it nor not based on that.  See http://www.bugzilla.org/docs/ and pick the [api] link next to the version of Bugzilla you're using.  Look for Bugzilla::Extension for information about how to make an extension.  There's a section for Template Hooks.  The template where those fields are displayed is bug/edit.html.tmpl and the hook name is 'custom_field', so you would create a template in your extension named hook/bug/edit-custom_field.html.tmpl .  In that template you can check if the user is in the correct group or not, and set field.hidden = 1 to hide the field.

santoshreddyspy <[hidden email]> wrote:

>Hi Everyone,
>
>I've created a custom field while creating Bug. This field should
>appear for
>certain users. How to make it possible?
>
>
>
>--
>View this message in context:
>http://mozilla.6506.n7.nabble.com/Custom-Field-tp263235.html
>Sent from the Bugzilla - Users mailing list archive at Nabble.com.
>_______________________________________________
>support-bugzilla mailing list
>[hidden email]
>https://lists.mozilla.org/listinfo/support-bugzilla
>PLEASE put [hidden email] in the To: field when you
>reply.

--
Dave Miller                                     http://www.justdave.net/
IT Infrastructure Engineer, Mozilla            http://www.mozilla.org/
Project Leader, Bugzilla Bug Tracking System    http://www.bugzilla.org/
_______________________________________________
support-bugzilla mailing list
[hidden email]
https://lists.mozilla.org/listinfo/support-bugzilla
PLEASE put [hidden email] in the To: field when you reply.