<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Remi,<br>
<br>
HA! you're right. That's a bit convoluted but, what the hey. I
"gotta do what I gotta do". This will be helpful in validating CF
entries for certain Queues. Thanks.<br>
<br>
Kenn<br>
LBNL<br>
<br>
On 6/10/2009 8:12 AM, Rémi wrote:
<blockquote
cite="mid:5a4fb0f70906100812pdbd14e9v3c381228b061d81@mail.gmail.com"
type="cite">
<div>Hi Ken,</div>
<div><br>
</div>
<div>here is the code I use to do what you want (quite painful like
Jesse says ...)</div>
<div><br>
</div>
<div>my $CustomFieldObj =
RT::CustomField->new($_[0]->CurrentUser);</div>
<div>$CustomFieldObj->LoadById($field);</div>
<div>my $CFVs = $CustomFieldObj->Values;</div>
<div>while ($CFVs and my $value = $CFVs->Next ) {</div>
<div> if ($value->Name eq
$_[0]->FirstCustomFieldValue($field)){</div>
<div> return $value->Category;</div>
<div> }</div>
<div>}</div>
<div><br>
</div>
<div>($_[0] is a the Ticket object and $field is the CF id)</div>
<div><br>
</div>
<div><br>
</div>
<div>Rémi</div>
<div><br>
</div>
<br>
<div class="gmail_quote">2009/6/9 Ken Crocker <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:kfcrocker@lbl.gov">kfcrocker@lbl.gov</a>></span><br>
<blockquote class="gmail_quote"
style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div bgcolor="#ffffff" text="#000000">
Jesse,<br>
<br>
<br>
Painful?? Please explain. I'd love to hear it.<br>
<br>
Kenn<br>
LBNL
<div class="im"><br>
<br>
On 6/9/2009 11:56 AM, Jesse Vincent wrote:
<blockquote type="cite">
<pre>On Tue 9.Jun'09 at 11:26:08 -0700, Ken Crocker wrote:
</pre>
<blockquote type="cite">
<pre>Jesse,
I was thinking that that particular command gave me the Custom Field value
only. I don't see where the "category" value for that CF can be determined from
that code.
</pre>
</blockquote>
<pre>Indeed. I misread your question. Category is an attribute of the
CustomFieldValue, itself. Getting at it will require some more work
and will be a bit painful
</pre>
</blockquote>
</div>
</div>
<br>
_______________________________________________<br>
<a moz-do-not-send="true"
href="http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users"
target="_blank">http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users</a><br>
<br>
Community help: <a moz-do-not-send="true"
href="http://wiki.bestpractical.com" target="_blank">http://wiki.bestpractical.com</a><br>
Commercial support: <a moz-do-not-send="true"
href="mailto:sales@bestpractical.com">sales@bestpractical.com</a><br>
<br>
<br>
Discover RT's hidden secrets with RT Essentials from O'Reilly Media.<br>
Buy a copy at <a moz-do-not-send="true"
href="http://rtbook.bestpractical.com" target="_blank">http://rtbook.bestpractical.com</a><br>
</blockquote>
</div>
<br>
</blockquote>
</body>
</html>