[rt-users] Fun with custom fields
David Z Maze
dmaze at cag.lcs.mit.edu
Wed Sep 3 17:01:55 EDT 2003
Two questions on custom fields:
(1) The Administrator Question: I've created a "enter multiple values"
field on a queue. When I visit Ticket/Modify.html for a
particular ticket, there's an edit box prompting me to "enter
multiple values". How do I do that? "One value to a line" isn't
it; I just get one big value with multiple lines to it.
(2) The Hacker Question: I have some HTML::Mason code that gets the
list of possible values, then displays them, along with any
tickets that have that value. The code looks like:
<tr class=<%$Class%>><td><b><%$Name%></b><br>
% foreach my $value (@$Values) {
<%$value%>
<%PERL>
$Tickets->ClearRestrictions;
$Tickets->LimitStatus(VALUE => "new");
$Tickets->LimitStatus(VALUE => "open");
$Tickets->LimitQueue(VALUE => "Bugs", OPERATOR => "=");
$Tickets->LimitCustomField(CUSTOMFIELD => 3, OPERATOR => "=",
VALUE => "$Name $value");
while (my $Ticket = $Tickets->Next) {
</%PERL>
<a href="<%$RT::WebPath%>/Ticket/Display.html?id=<%$Ticket->Id%>"><%$Ticket->id%>
(<%$Ticket->OwnerObj->Name%>) <%$Ticket->Subject%></a>
% }
<br>
% }
</td></tr>
<%INIT>
my $Tickets = RT::Tickets->new($session{'CurrentUser'});
</%INIT>
<%ARGS>
$Class => 'oddline'
$Name => undef
$Values => []
</%ARGS>
Is this, in fact, the best way to do it? It feels vaguely
sluggish, though I haven't looked into it more; I assume throwing
an index at the values of the custom field would help.
I'm also open to UI suggestions. The listing looks sort of like this:
Name 1, which is potentially quite long
Case 1: 1 (Nobody) Case 1 is broken, 2 (dmaze) Cases 1-3 need help
Case 2: 2 (dmaze) Cases 1-3 need help
Name 2, also potentially quite long
Case 3: 2 (dmaze) Cases 1-3 need help
Case 4
Right now "Name 1", "Name 2", "Name 3", etc. are in alternating colors
(evenrow, oddrow); I have no good way of dealing if the list of
tickets associated with a particular case overflow. I'd also like a
more convenient way of associating a case with a ticket, rather than
forcing users to type out the full name of the name and case possibly
mult8iple times.
--
David Z. Maze dmaze at cag.lcs.mit.edu
Research Scientist http://www.mit.edu/~dmaze/
MIT LCS Computer Architecture Group http://www.cag.lcs.mit.edu/commit/
More information about the rt-users
mailing list