[rt-users] Help with a template
Joe Kirby
kirby at umbc.edu
Wed Dec 2 10:35:08 EST 2015
Matt
I appreciate the suggestion however as a non-perl programmer I am not able to transition this to my template
I was hoping to have some command that would replace this line in the template so the child ticket could receive all the values from the parent as I am creating this dynamical via script/template
ITNM-Topic: {$Tickets{'TOP'}->FirstCustomFieldValue('ITNM-Topic’)}
If the code provided does that and my lack of knowledge of this scripting language is the issue please just let me know and I will look into other options
Thanks
Joe
Joe Kirby , Assistant Vice President, Business Systems
Division of Information Technology (DoIT)
Support Response - http://www.umbc.edu/doit
Administration 627
Office - 410-455-3020
Email - kirby at umbc.edu
> On Dec 1, 2015, at 5:35 PM, Matt Zagrabelny <mzagrabe at d.umn.edu> wrote:
>
> On Tue, Dec 1, 2015 at 4:21 PM, Joe Kirby <kirby at umbc.edu> wrote:
>> I have a need to create a child ticket and pass on the values for a shared
>> custom field.
>>
>> This works fine when passing a field which is limited to 1 value however I
>> now have a multi-value custom field and I cannot find any examples of how to
>> pass the secondary values if they exist.
>
> There are a couple of ways.
>
> 1) Use the built-in method.
>
> CustomFieldValuesAsString
>
> more about it can be found in:
>
> lib/RT/Record.pm
>
> 2) Have full control over the output.
>
> Here is an example that builds an HTML list:
>
> {
> my $cf = $Ticket->LoadCustomFieldByIdentifier('Multimedia Hub
> Equipment');
> my $equipment = $cf->ValuesForObject($Ticket)->ItemsArrayRef;
>
> $html_equipment = 'No equipment listed.';
>
> if (@$equipment > 0) {
> $html_equipment = '<ul>';
> for my $item (@$equipment) {
> my $content = $item->Content;
> RT::Interface::Web::EscapeHTML(\$content);
> $html_equipment .= '<li>'.$content.'</li>';
> }
> $html_equipment .= '</ul>';
> }
>
> $html_equipment;
> }
>
> Cheers,
>
> -m
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20151202/c815e882/attachment.htm>
More information about the rt-users
mailing list