[rt-users] Assign custom field to subject

Gene LeDuc gleduc at mail.sdsu.edu
Wed Mar 26 12:31:41 EDT 2008


Hi Laura,

I think your approach should work, but I don't think you can set the 
subject with a direct assignment like that.
Try $self->TicketObj->SetSubject($subject) instead.

Also, I don't think you should be replacing spaces with underscores in the 
CF name; leave the spaces.

Regards,
Gene

At 09:01 AM 3/26/2008, lgrella wrote:

>I have a user who would like the subject to be a drop down list of choices. I
>have not seen how to do this, so I have decided to create a custom field of
>a drop down list of choices, and if the subject is blank, move this custom
>field choice into the subject. I am not being successful. I have 2
>questions:
>
>1. Can I make the subject a drop down list for one queue,  rather than an
>type in field?
>2. If not, does anyone see anything wrong with my code:
>
>here is the custom preparation code:
>return 0 unless (!$self->TicketObj->Subject);
>return 1;
>
>and here is the custom cleanup code:
># move the contents of the custom field into the subject
># the name of my custom field is Choose subject here
>my $subject =
>$self->TicketObj->FirstCustomFieldValue('Choose_subject_here');
>
>$self->TicketObj->Subject=$subject;
>return 1;
>
>###################################
>Does the name of the field, since it has spaces, have to include
>underscores? I did it that way, and for testing purposes, even chose a
>custom field of one word to eliminate the question.
>
>Thanks,
>Laura


-- 
Gene LeDuc, GSEC
Security Analyst
San Diego State University 




More information about the rt-users mailing list