<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">

<head>

<meta name=Generator content="Microsoft Word 12 (filtered medium)">
<style>
<!--
 /* Font Definitions */
 @font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:"Century Gothic";
        panose-1:2 11 5 2 2 2 2 2 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
@font-face
        {font-family:"Segoe UI";
        panose-1:2 11 5 2 4 2 4 2 2 3;}
 /* Style Definitions */
 p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman","serif";
        color:black;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"Preformattato HTML Carattere";
        margin:0cm;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";
        color:black;}
span.PreformattatoHTMLCarattere
        {mso-style-name:"Preformattato HTML Carattere";
        mso-style-priority:99;
        mso-style-link:"Preformattato HTML";
        font-family:Consolas;
        color:black;}
span.StileMessaggioDiPostaElettronica19
        {mso-style-type:personal-reply;
        font-family:"Century Gothic","sans-serif";
        color:blue;
        font-weight:normal;
        font-style:normal;
        text-decoration:none none;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page Section1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.Section1
        {page:Section1;}
-->
</style>
<!--[if gte mso 9]><xml>
 <o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
 <o:shapelayout v:ext="edit">
  <o:idmap v:ext="edit" data="1" />
 </o:shapelayout></xml><![endif]-->
</head>

<body bgcolor=white lang=EN-US link=blue vlink=purple>

<div class=Section1>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Century Gothic","sans-serif";
color:blue'>Hi Ken,<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Century Gothic","sans-serif";
color:blue'>what do you mean by category?<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Century Gothic","sans-serif";
color:blue'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Century Gothic","sans-serif";
color:blue'>Here is part of a scrip I use on our system (RT 3.8.3) that will
print (in the log) the CF name, type and validation pattern. See if that helps.<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Century Gothic","sans-serif";
color:blue'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:windowtext'>my $ticket = $self->TicketObj;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:windowtext'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:windowtext'>my $CustomFields =
$ticket->QueueObj->TicketCustomFields();<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:windowtext'>while (my $CustomField = $CustomFields->Next()) {<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:windowtext'>    my $nam = $CustomField->Name;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:windowtext'>    my $typ = $CustomField->Type;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:windowtext'>    my $vad = $CustomField->Pattern;<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:windowtext'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:windowtext'>    $RT::Logger->info( ">  CustomField: $nam
\n" );<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:windowtext'>    $RT::Logger->info( ">  CustomField: $typ
\n" );<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:windowtext'>    $RT::Logger->info( ">  CustomField: $vad
\n" );<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Courier New";
color:windowtext'>}<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Century Gothic","sans-serif";
color:blue'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Century Gothic","sans-serif";
color:blue'>Bye<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Century Gothic","sans-serif";
color:blue'>Cris<o:p></o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Century Gothic","sans-serif";
color:blue'><o:p> </o:p></span></p>

<p class=MsoNormal><span style='font-size:11.0pt;font-family:"Century Gothic","sans-serif";
color:blue'><o:p> </o:p></span></p>

<div>

<div style='border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0cm 0cm 0cm'>

<p class=MsoNormal><b><span lang=IT style='font-size:10.0pt;font-family:"Segoe UI","sans-serif";
color:windowtext'>Da:</span></b><span lang=IT style='font-size:10.0pt;
font-family:"Segoe UI","sans-serif";color:windowtext'>
rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] <b>Per conto di </b>Ken
Crocker<br>
<b>Inviato:</b> marted́ 9 giugno 2009 20.26<br>
<b>A:</b> Jesse Vincent<br>
<b>Cc:</b> rt Users<br>
<b>Oggetto:</b> Re: [rt-users] Question on use of Category in a scrip<o:p></o:p></span></p>

</div>

</div>

<p class=MsoNormal><o:p> </o:p></p>

<p class=MsoNormal>Jesse,<br>
<br>
    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.<br>
<br>
Kenn<br>
LBNL<br>
<br>
On 6/9/2009 9:24 AM, Jesse Vincent wrote: <o:p></o:p></p>

<pre><o:p> </o:p></pre><pre><o:p> </o:p></pre><pre>On Tue, Jun 09, 2009 at 09:21:41AM -0700, Ken Crocker wrote:<o:p></o:p></pre><pre>  <o:p></o:p></pre>

<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><pre>To List,<o:p></o:p></pre><pre><o:p> </o:p></pre><pre>    Has anyone used the category of a Custom Field in a scrip? Does <o:p></o:p></pre><pre>anyone know how to access that information in a scrip? I need to create <o:p></o:p></pre><pre>a scrip where I need that information. Thanks.<o:p></o:p></pre><pre>    <o:p></o:p></pre></blockquote>

<pre><o:p> </o:p></pre><pre>$TicketObj->FirstCustomFieldValue('The CF Name');<o:p></o:p></pre><pre><o:p> </o:p></pre><pre><o:p> </o:p></pre><pre><o:p> </o:p></pre><pre>  <o:p></o:p></pre>

<blockquote style='margin-top:5.0pt;margin-bottom:5.0pt'><pre>Kenn<o:p></o:p></pre><pre>LBNL<o:p></o:p></pre><pre>_______________________________________________<o:p></o:p></pre><pre><a
href="http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users">http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users</a><o:p></o:p></pre><pre><o:p> </o:p></pre><pre>Community help: <a
href="http://wiki.bestpractical.com">http://wiki.bestpractical.com</a><o:p></o:p></pre><pre>Commercial support: <a
href="mailto:sales@bestpractical.com">sales@bestpractical.com</a><o:p></o:p></pre><pre><o:p> </o:p></pre><pre><o:p> </o:p></pre><pre>Discover RT's hidden secrets with RT Essentials from O'Reilly Media. <o:p></o:p></pre><pre>Buy a copy at <a
href="http://rtbook.bestpractical.com">http://rtbook.bestpractical.com</a><o:p></o:p></pre><pre><o:p> </o:p></pre><pre>    <o:p></o:p></pre></blockquote>

<pre><o:p> </o:p></pre><pre>  <o:p></o:p></pre></div>

</body>

</html>