pjdavis / roart

Interface for working with Request Tracker (RT) tickets inspired by ActiveRecord.
28 stars 15 forks source link

Will roart have access to custom fields? #3

Closed abhas closed 13 years ago

abhas commented 13 years ago

I want to access user and ticket custom fields via roart. Will I be able to access these custom fields via roart?

-abhas.

pjdavis commented 13 years ago

Yes, you should have access to them right now.

To search, it would look something like: MyTicket.find(:first, :custom_fields => {:phone => '8675309'}

and to get/set custom fields, you can do something like this: myticketinstance.cf_phone = '3334443434' myticketinstance.cf_phone #=> '3334443434'

Custom fields are added to the attributes of the ticket instance by prepending them with 'cf_'. Also note that the custom field name is case sensitive. so if you had a custom field in RT with the name ZipCode, the ticket object attribute would be cf_ZipCode.

abhas commented 13 years ago

Thanks a lot for your response.

What about transaction custom fields or user custom fields? I basically want to match a user custom field and a ticket custom field and based on that provide access to tickets?

Alternatively I could access one of the standard attributes of a user and match that. From the documentation I see that currently I can only access data related to tickets not users. I think I am missing something here. :(