Hide fields in tickets

14 views
Skip to first unread message

patrick

unread,
Apr 28, 2009, 8:43:35 AM4/28/09
to Trac Users
Hi,

is it possible to modify this plugin (blackmagic) in such a way that
some fields are not visible in a certain state of the ticket
e.g. in state new the milestone and severity field should be hidden,
also the possibility that custom fields are not shown.

new.hide = milestone, severity

or is there another plugin that does the same?

Thanks in advance

Ethan Jucovy

unread,
Apr 28, 2009, 9:05:14 AM4/28/09
to patrick...@gmail.com, trac-...@googlegroups.com

http://trac-hacks.org/wiki/TicketSubmitPolicyPlugin is quite simliar in concept -- it lets you enforce required and forbidden fields according to fairly arbitrary conditions on the ticket's state:
{{{
mypolicy.condition = type is defect && component is not component2
mypolicy.requires = version, milestone
mypolicy.excludes = severity
}}}

It's been a while since I've used it so I don't remember if it actually hides the fields ... but if it doesn't & you need that, it ought to be an easy (maybe even one line) extension to write in Javascript -- that plugin already uses Javascript to enforce the policies, so the code structure should all be in place, just a matter of finding where to put the extra line.

hth,
egj

Jeff Hammel

unread,
Apr 28, 2009, 9:38:07 AM4/28/09
to trac-...@googlegroups.com
On Tue, Apr 28, 2009 at 09:05:14AM -0400, Ethan Jucovy wrote:
> On Tue, Apr 28, 2009 at 8:43 AM, patrick <[1]patrick...@gmail.com>

> wrote:
>
> is it possible to modify this plugin (blackmagic) in such a way that
> some fields are not visible in a certain state of the ticket
> e.g. in state new the milestone and severity field should be hidden,
> also the possibility that custom fields are not shown.
>
> new.hide = milestone, severity
>
> or is there another plugin that does the same?
>
> [2]http://trac-hacks.org/wiki/TicketSubmitPolicyPlugin is quite simliar in

> concept -- it lets you enforce required and forbidden fields according to
> fairly arbitrary conditions on the ticket's state:
> {{{
> mypolicy.condition = type is defect && component is not component2
> mypolicy.requires = version, milestone
> mypolicy.excludes = severity
> }}}
>
> It's been a while since I've used it so I don't remember if it actually
> hides the fields ... but if it doesn't & you need that, it ought to be an
> easy (maybe even one line) extension to write in Javascript -- that plugin
> already uses Javascript to enforce the policies, so the code structure
> should all be in place, just a matter of finding where to put the extra
> line.
>
> hth,
> egj

It should be noted that several people have complained that the labels are shown even when the fields are hidden: http://trac-hacks.org/ticket/4464
I apologize for not being able to look into this right now. I have recently received 20% time at my job, so when that comes on line I will devote it to the rather vast number of tickets and bugs in my plugins (as always, patches and/or contributors welcome).

Jeff

yoheeb

unread,
Apr 28, 2009, 10:10:35 AM4/28/09
to Trac Users
On Apr 28, 8:38 am, Jeff Hammel <jham...@openplans.org> wrote:
>
> >    [2]http://trac-hacks.org/wiki/TicketSubmitPolicyPluginis quite simliar in
> >    concept -- it lets you enforce required and forbidden fields according to
> >    fairly arbitrary conditions on the ticket's state:
> >    {{{
> >    mypolicy.condition = type is defect && component is not component2
> >    mypolicy.requires = version, milestone
> >    mypolicy.excludes = severity
> >    }}}
<snip>
>
> It should be noted that several people have complained that the labels are shown even when the fields are hidden:http://trac-hacks.org/ticket/4464
> I apologize for not being able to look into this right now.  I have recently received 20% time at my job, so when that comes on line I will devote it to the rather vast number of tickets and bugs in my plugins (as always, patches and/or contributors welcome).
>
> Jeff

This plugin is still a bit buggy. however it has the right idea, and
hopefully it will get some fleshing out in the future. that said, it
is in the right direction, and would be a good starting point to work
with if you wanted to roll your own, or just pick it up and contribute.

patrick

unread,
Apr 28, 2009, 10:25:03 AM4/28/09
to Trac Users
Hi, thanks all

I will check the plugin and will try to correct it, but my Python/java
script knowledge is not so good.
if solved it will attach it to the ticket 4464

again thanks


On Apr 28, 4:10 pm, yoheeb <yoh...@gmail.com> wrote:
> On Apr 28, 8:38 am, Jeff Hammel <jham...@openplans.org> wrote:
>
>
>
> > >    [2]http://trac-hacks.org/wiki/TicketSubmitPolicyPluginisquite simliar in
Reply all
Reply to author
Forward
0 new messages