[rt-users] Help with a template

Matt Zagrabelny mzagrabe at d.umn.edu
Wed Dec 2 11:14:18 EST 2015


Hi Joe,

This is a guess - as we don't make use of creating child tickets with
templates.

Replace the line, "ITNM-Topic:
{$Tickets{'TOP'}->CustomFieldValuesAsString('ITNM-Topic’)}" with the
following:

{
 my $cf = $Tickets{TOP}->LoadCustomFieldByIdentifier('ITNM-Topic');
 my $topics = $cf->ValuesForObject($Tickets{TOP})->ItemsArrayRef;

 join "\n",
     map { "ITNM-Topic: " . $_->Content }
     @$topics
 ;
}

The idea here is to insert into the template a line of:

ITNM-Topic: [blah]

for each value in your CF.

Alternatively to test things out, use the original line and an additional
line to see if you can pass multiple values to a child ticket's CF:

ITNM-Topic: {$Tickets{'TOP'}->FirstCustomFieldValue('ITNM-Topic’)}
ITNM-Topic: testing_multiple_values

Hopefully that child ticket will have two values in its ITNM-Topic CF.

Hope that helps!

-m


On Wed, Dec 2, 2015 at 9:56 AM, Joe Kirby <kirby at umbc.edu> wrote:

> Thanks Matt
>
> When I do this ITNM-Topic:
> {$Tickets{'TOP'}->CustomFieldValuesAsString('ITNM-Topic’)} I still just get
> the first 1 in the list for the child ticket. It show fine in the parent
> ticket of course but is not transferring down to the child.
>
> I am on 4.2.11
>
> I appreciate your quick responses and ideas
>
> I included a snapshot of the parent and child in case that helped.
>
>
> 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 2, 2015, at 10:38 AM, Matt Zagrabelny <mzagrabe at d.umn.edu> wrote:
>
> On Wed, Dec 2, 2015 at 9:35 AM, Joe Kirby <kirby at umbc.edu> wrote:
>
> Matt
>
> I appreciate the suggestion however as a non-perl programmer I am not able
> to transition this to my template
>
>
> Sure.
>
> 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’)}
>
>
> Just replace the "FirstCustomFieldValue" with "CustomFieldValuesAsString".
>
> -m
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20151202/85849394/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2015-12-02 at 10.55.34 AM.png
Type: image/png
Size: 7180 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20151202/85849394/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screen Shot 2015-12-02 at 10.54.57 AM.png
Type: image/png
Size: 11382 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20151202/85849394/attachment-0001.png>


More information about the rt-users mailing list