I've gotten a little further now with the following code:<br><br><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex; font-family: courier new,monospace;" class="gmail_quote">
my $my_rq = $self->TicketObj->RequestorAddresses;<br><br>my $temp_user = RT::User->new();<br>$temp_user->LoadByEmail($my_rq);<br>my $rq_org = $temp_user->Organization();<br><br>$self->TicketObj->AddCustomFieldValue(Field => 'Oplossing', Value => $rq_org);<br>
<br>return 1;<br></blockquote><br>But, getting a custom field value from that user (instead of the regular organization field) doesn't seem to work.<br>I've tried the following line for getting the User CF:<br><br>
<blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote"><span style="font-family: courier new,monospace;">my $rq_org = $temp_user->FirstCustomFieldValue('CF Name');</span><br>
</blockquote><br>Any thoughts on how to get the User CF?<br><br><br clear="all">-- Bart<br>
<br><br><div class="gmail_quote">2011/10/5 Bart <span dir="ltr"><<a href="mailto:bart@pleh.info">bart@pleh.info</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
If I were to use the UserObj, how would that look?<br><br>I find it difficult to make the transition from requestor e-mail address to used ID and from there to a users custom field O_o<span style="font-family:courier new,monospace"><br>
<br><font face="arial,helvetica,sans-serif">As for the More about requestors box, we like the default usage lol + we want the ability to make reports/charts based on the value of the tickets Organisation field.</font><br>
</span><br clear="all">-- Bart<br>
<br><br><div class="gmail_quote">2011/10/5 Kevin Falcone <span dir="ltr"><<a href="mailto:falcone@bestpractical.com" target="_blank">falcone@bestpractical.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div><div></div><div class="h5">
<div><div></div><div>On Wed, Oct 05, 2011 at 09:08:37AM -0500, <a href="mailto:ktm@rice.edu" target="_blank">ktm@rice.edu</a> wrote:<br>
> On Wed, Oct 05, 2011 at 03:31:32PM +0200, Bart wrote:<br>
> > Hi,<br>
> ><br>
> > For users we've added an extra CF which is an autocomplete field containing<br>
> > a list of roughly 450 organisations that we work with. We had to make a<br>
> > separate CF for this in order to help our users a little, saves typo's and<br>
> > makes adding an organisation to a user easy. So basically we're ignoring the<br>
> > RT default Organisation field and have a separate CF for this purpose.<br>
> ><br>
> > The second thing we now want is to show that organisation name (the one in<br>
> > the organisation CF) in our tickets, so that we can make nice reports based<br>
> > on that information.<br>
> > This is where I'm stuck, I can't seem to figure out how to read the CF for a<br>
> > requestor (or any user) and thus am unable to write the value into a ticket<br>
> > CF.<br>
> ><br>
> > I know how to read and write into ticket CF's, but I have no clue on how to<br>
> > read information from a requestor of a ticket.<br>
> ><br>
> > Reading information from a tidcket CF:<br>
> ><br>
> > $self->TicketObj->FirstCustomFieldValue('Custom Field Name');<br>
> ><br>
> > Writing information into a ticket CF:<br>
> ><br>
> > $self->TicketObj->AddCustomFieldValue(Field => 'Custom Field Name', Value =><br>
> > $my_owner);<br>
> ><br>
> > Or, instead of a variable use a fixed value between single quotes.<br>
> ><br>
> > I also know that this piece of code gets a ticket requestor e-mail address:<br>
> ><br>
> > my $requestor_address = $self->TicketObj->RequestorAddresses;<br>
> ><br>
> > But thats about as far as I'm able to get....<br>
> ><br>
> > Can anyone point me in the right direction for this one?<br>
> ><br>
> ><br>
> > -- Bart<br>
><br>
> Hi Bart,<br>
><br>
> If I am understanding your question, you want to be able to script<br>
> reading/writing User custom fields. It happens that I have hit the<br>
> same stumbling block. It is easy to update Ticket custom fields, but<br>
> I would like to do the same with User CFs. The only thing that looks<br>
> like it would work is RT::Record, ugh. I hope that someone has a<br>
> better option... patch for REST, the RT CLI...? Any help would be<br>
> appreciated.<br>
<br>
</div></div>Have you tried FirstCustomFieldValue or AddCustomFieldValue on a User object?<br>
They're RT::Record methods, and thus available on all RT objects<br>
(although it only makes sense on the ones that have CFs applied).<br>
<br>
RT4 also allows customization of the More about Requestors box from<br>
the config using Formats so you can just display the User CF directly<br>
rather than copying.<br>
<font color="#888888"><br>
-kevin<br>
</font><br></div></div>--------<br>
RT Training Sessions (<a href="http://bestpractical.com/services/training.html" target="_blank">http://bestpractical.com/services/training.html</a>)<br>
* San Francisco, CA, USA — October 18 & 19, 2011<br>
* Washington DC, USA — October 31 & November 1, 2011<br>
* Barcelona, Spain — November 28 & 29, 2011<br></blockquote></div><br>
</blockquote></div><br>