[rt-users] I forgot how to do this

Forrest Blount forrestarthur at gmail.com
Wed Aug 8 16:24:01 EDT 2007


Why do you need a query to do this?  Can't you just look at Configuration->
CustomFields->YourCustomField and view its current value options?

If you need to do a SQL query, use:
SELECT DISTINCT CustomFieldValues.Name FROM CustomFieldValues JOIN
CustomFields ON CustomFields.id=CustomFieldValues.CustomField WHERE
CustomField.Name='YourCustomField' AND CustomFieldValues.Disabled=0;

If you want ALL customfieldvalues for the field (and not just the current
ones) get rid of the Disabled specification.

Forrest

On 8/8/07, James Moseley <jmoseley at corp.xanadoo.com> wrote:
>
> I am sure you can do this by using a single mysql command, but...
>
> To get the numeric id of the custom field:
>
> mysql> select id from CustomFields where Name='<custom field name>';
>
> Grab the id, then:
>
> mysql> select * from CustomFieldValues where CustomField='<id>';
>
> James Moseley
>
>
>
>
>
>              Mathew Snyder
>              <theillien at yahoo.
>              com>                                                       To
>              Sent by:                  RT Users
>              rt-users-bounces@         <rt-users at lists.bestpractical.com>
>              lists.bestpractic                                          cc
>              al.com
>                                                                    Subject
>                                        [rt-users] I forgot how to do this
>              08/08/2007 02:40
>              PM
>
>
>
>
>
>
>
>
> I need to get a list of all of the values for one particular custom field.
> I
> had a script which did this after about a week or two of banging my head
> against
> my desk.  However, I no longer have this script and am left banging my
> head
> again as I've forgotten how to gather this list up.
>
> I've tried using CustomFieldValue, CustomFieldValues, CustomField and
> CustomFields.  I can't for the life of me figure out how to do this.  Can
> someone point me in the right direction?
>
> --
> Keep up with me and what I'm up to: http://theillien.blogspot.com
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Community help: http://wiki.bestpractical.com
> Commercial support: sales at bestpractical.com
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
>
>
> _______________________________________________
> http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users
>
> Community help: http://wiki.bestpractical.com
> Commercial support: sales at bestpractical.com
>
>
> Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
> Buy a copy at http://rtbook.bestpractical.com
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20070808/0fb371dd/attachment.htm>


More information about the rt-users mailing list