we are trying to use a script, which puts the input of two CustomFields into the subject. We already found a way to manage it, but it only works with one CustomField:
here is the custom preparation code:
return 0 unless (!$self->TicketObj->Subject);
return 1;
custom cleanup code:
my $subject1 = $self->TicketObj->FirstCustomFieldValue(‘Choose_subject_here’);
my $subject2 = $self->TicketObj->FirstCustomFieldValue(‘Choose_subject_here’);
If we create a new variable and try to concat both, it only uses one. Do we use the wrong Method(FirstCustomFieldValue) or do we need to concat the variables in a special way?
Unless I’m mis-reading/mis-understanding, you’re getting the value from the same custom field and putting it into $subject1 and $subject2 variables. If you have two custom fields, I’d have expected to see to different names in the FirstCustomFieldValue() parameter.
my $subject1 = $self->TicketObj->FirstCustomFieldValue(‘First’)->Content;
my $subject2 = $self->TicketObj->FirstCustomFieldValue(‘Second')->Content;
$self->TicketObj->SetSubject("$subject1 $subject2");