I agree that it might be good to have this information in the Wiki. <div>But the solution I proposed is probably not the better one and could cause some unwanted load on the system.</div><div><br></div><div>Even if we can't access the "CF Category" directly by the RT API, I 'm sure we can do it with a simple sql query, </div>
<div>I'm a bit confused with the RT DB schema to do it fast, I will work on it when I have some time.</div><div>If somebody can help me doing this, it will be welcome.</div><div><br></div><div><br><div class="gmail_quote">
2009/6/11 Cassandra Phillips-Sears <span dir="ltr"><<a href="mailto:cassandra@bestpractical.com">cassandra@bestpractical.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div style="word-wrap:break-word">It might be good if someone could update the wiki with this code, but I don't think I should be the one to do it as I'm not a programmer. ;) I think it might be helpful for others trying to answer this question in the future.<br>
<font color="#888888"><div> <span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-align:auto;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">
<span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">
<span style="border-collapse:separate;color:rgb(0, 0, 0);font-family:Helvetica;font-size:12px;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;line-height:normal;text-indent:0px;text-transform:none;white-space:normal;word-spacing:0px"><div style="word-wrap:break-word">
<div><div>--</div><div>Cassandra Phillips-Sears</div><div>Office Manager</div><div>Best Practical Solutions, LLC</div><div><a href="http://www.bestpractical.com" target="_blank">http://www.bestpractical.com</a></div></div>
</div></span></div></span></div></span> </div></font><div><div></div><div class="h5"><br><div><div>On Jun 10, 2009, at 11:12 AM 6/10/09, Rémi wrote:</div><br><blockquote 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 href="mailto:kfcrocker@lbl.gov" target="_blank">kfcrocker@lbl.gov</a>></span><br> <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;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><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 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 href="http://wiki.bestpractical.com" target="_blank">http://wiki.bestpractical.com</a><br> Commercial support: <a href="mailto:sales@bestpractical.com" target="_blank">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 href="http://rtbook.bestpractical.com" target="_blank">http://rtbook.bestpractical.com</a><br></blockquote></div>
<br> _______________________________________________<br><a 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 href="http://wiki.bestpractical.com" target="_blank">http://wiki.bestpractical.com</a><br>Commercial support: <a href="mailto:sales@bestpractical.com" target="_blank">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 href="http://rtbook.bestpractical.com" target="_blank">http://rtbook.bestpractical.com</a></blockquote></div><br></div>
</div></div><br>_______________________________________________<br>
<a 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 href="http://wiki.bestpractical.com" target="_blank">http://wiki.bestpractical.com</a><br>
Commercial support: <a 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 href="http://rtbook.bestpractical.com" target="_blank">http://rtbook.bestpractical.com</a><br></blockquote></div><br></div>