Assign custom field to subject

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

View this message in context: http://www.nabble.com/Assign-custom-field-to-subject-tp16304462p16304462.html

I would go with a variation of
http://wiki.bestpractical.com/view/SelectRequestor

Instead of selects to populate the box, just pre-define some and use the
javascript to let a user enter his or her own subject.

lgrella wrote:

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

Thank you Gene, it works perfectly!

–Laura

Gene LeDuc wrote:

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


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

View this message in context: http://www.nabble.com/Assign-custom-field-to-subject-tp16304462p16310486.html