Template Help

I’m using the following template to create an approval ticket. I would like to include the following lines into the ticket:

Click on the link below to send an approval email:
mailto:rt@domain.com?subject=%5B{$rtname}%20#{$Ticket->id()}%5D&body=%20Status:%20resolved

Click on the link below to send a rejection email:
mailto:rt@domain.com?subject=%5B{$rtname}%20#{$Ticket->id()}%5D&body=%20Status:%20rejected

I am getting the following error:
Click on the link below to send an approval email:
mailto:rt@domain.com?subject=%5B%20#Can’t call method “id” on an undefined value at template line 29.

Stack:
[template:29]
[/usr/lib/rt/RT/Action/CreateTickets.pm:667]
[/usr/lib/rt/RT/Action/CreateTickets.pm:366]
[/usr/lib/rt/RT/Action/CreateTickets.pm:303]
[/usr/lib/rt/RT/ScripAction_Overlay.pm:238]
[/usr/lib/rt/RT/Scrip_Overlay.pm:464]
[/usr/lib/rt/RT/Scrips_Overlay.pm:196]
[/usr/lib/rt/RT/Scrips_Overlay.pm:175]
[/usr/lib/rt/RT/Ticket_Overlay.pm:3186]
[/var/rt/html/Ticket/Create.html:392]
[/var/rt/html/autohandler:311]
%5D&body=%20Status:%20resolved

Is there a way to get the id of the ticket that will be created with the template? Please help, the ability to just be able to click on the link instead of worrying about formatting would be a great addition to the approval queue. It works with correspondence and comments.

Here is my Template:

===Create-Ticket: approval
Queue: ___Approvals
Type: approval
AdminCc: {$Tickets{‘TOP’}->FirstCustomFieldValue(‘OracleApprovers’)};
Depended-On-By: TOP
Refers-To: TOP
CF-ApprovalType: Oracle
Due: {time + 86400}
Content: Your approval is required to grant access to Oracle for {$Tickets{‘TOP’}->FirstCustomFieldValue(‘UserDisplayName’)}

To respond to this request, please click the following link to access your pending approvals:

http://rt.domain.com/Approvals

OR

You may submit your response via e-mail. To do so, reply to this message with one of the following responses in the
body of the message:

To approve:
Status: Resolved

To reject:
Status: Rejected

To view the original request, follow this link: {RT->Config->Get(‘WebURL’)}Ticket/Display.html?id={$Tickets{‘TOP’}->Id}

The actual approval request is below:
{$Tickets{‘TOP’}->Transactions->First->Content()}

ENDOFCONTENT

I’d still be interested in using this if there was an easy way to deal with this. I ended up creating a custom scrip and template in the __Approvals queue. I’ve added the line below to the template and it now allows people to just click on the link to send a pre-formatted email.-----Original Message-----
From: Jennifer Koermer
Sent: Wednesday, January 19, 2011 7:03 PM
To: rt-users@lists.bestpractical.com
Subject: Template Help

I’m using the following template to create an approval ticket. I would like to include the following lines into the ticket:

Click on the link below to send an approval email:
mailto:rt@domain.com?subject=%5B{$rtname}%20#{$Ticket->id()}%5D&body=%20Status:%20resolved

Click on the link below to send a rejection email:
mailto:rt@domain.com?subject=%5B{$rtname}%20#{$Ticket->id()}%5D&body=%20Status:%20rejected

I am getting the following error:
Click on the link below to send an approval email:
mailto:rt@domain.com?subject=%5B%20#Can’t call method “id” on an undefined value at template line 29.

Stack:
[template:29]
[/usr/lib/rt/RT/Action/CreateTickets.pm:667]
[/usr/lib/rt/RT/Action/CreateTickets.pm:366]
[/usr/lib/rt/RT/Action/CreateTickets.pm:303]
[/usr/lib/rt/RT/ScripAction_Overlay.pm:238]
[/usr/lib/rt/RT/Scrip_Overlay.pm:464]
[/usr/lib/rt/RT/Scrips_Overlay.pm:196]
[/usr/lib/rt/RT/Scrips_Overlay.pm:175]
[/usr/lib/rt/RT/Ticket_Overlay.pm:3186]
[/var/rt/html/Ticket/Create.html:392]
[/var/rt/html/autohandler:311]
%5D&body=%20Status:%20resolved

Is there a way to get the id of the ticket that will be created with the template? Please help, the ability to just be able to click on the link instead of worrying about formatting would be a great addition to the approval queue. It works with correspondence and comments.

Here is my Template:

===Create-Ticket: approval
Queue: ___Approvals
Type: approval
AdminCc: {$Tickets{‘TOP’}->FirstCustomFieldValue(‘OracleApprovers’)};
Cc: username@domain.com
Depended-On-By: TOP
Refers-To: TOP
CF-ApprovalType: Oracle
Due: {time + 86400}
Subject: Oracle Approval for ticket: {$Tickets{“TOP”}->Id} - {$Tickets{“TOP”}->Subject}
Content: Your approval is required to grant access to Oracle for {$Tickets{‘TOP’}->FirstCustomFieldValue(‘UserDisplayName’)}

To respond to this request, please click the following link to access your pending approvals:

http://rt.domain.com/Approvals

OR

You may submit your response via e-mail. To do so, reply to this message with one of the following responses in the body of the message:

To approve:
Status: Resolved

To reject:
Status: Rejected

To view the original request, follow this link: {RT->Config->Get(‘WebURL’)}Ticket/Display.html?id={$Tickets{‘TOP’}->Id}

The actual approval request is below:
{$Tickets{‘TOP’}->Transactions->First->Content()}

ENDOFCONTENT

Did you try just {$Ticket->id}? Works for me.

Request {$Ticket->id} was been created on {$Transaction->CreatedAsString} --- On Thu, 1/20/11, Jennifer Koermer wrote:

From: Jennifer Koermer JKoermer@prg.com
Subject: Re: [rt-users] Template Help
To: "rt-users@lists.bestpractical.com" rt-users@lists.bestpractical.com
Date: Thursday, January 20, 2011, 1:06 PM

I’d still be interested in using this if there was an easy way to deal with this. I ended up creating a custom scrip and template in the __Approvals queue. I’ve added the line below to the template and it now allows people to just click on the link to send a pre-formatted email.

-----Original Message-----
From: Jennifer Koermer
Sent: Wednesday, January 19, 2011 7:03 PM
To: rt-users@lists.bestpractical.com
Subject: Template Help

I’m using the following template to create an approval ticket. I would like to include the following lines into the ticket:

Click on the link below to send an approval email:
mailto:rt@domain.com?subject=%5B{$rtname}%20#{$Ticket->id()}%5D&body=%20Status:%20resolved

Click on the link below to send a rejection email:
mailto:rt@domain.com?subject=%5B{$rtname}%20#{$Ticket->id()}%5D&body=%20Status:%20rejected

I am getting the following error:
Click on the link below to send an approval email:
mailto:rt@domain.com?subject=%5B%20#Can’t call method “id” on an undefined value at template line 29.

Stack:
[template:29]
[/usr/lib/rt/RT/Action/CreateTickets.pm:667]
[/usr/lib/rt/RT/Action/CreateTickets.pm:366]
[/usr/lib/rt/RT/Action/CreateTickets.pm:303]
[/usr/lib/rt/RT/ScripAction_Overlay.pm:238]
[/usr/lib/rt/RT/Scrip_Overlay.pm:464]
[/usr/lib/rt/RT/Scrips_Overlay.pm:196]
[/usr/lib/rt/RT/Scrips_Overlay.pm:175]
[/usr/lib/rt/RT/Ticket_Overlay.pm:3186]
[/var/rt/html/Ticket/Create.html:392]
[/var/rt/html/autohandler:311]
%5D&body=%20Status:%20resolved

Is there a way to get the id of the ticket that will be created with the template? Please help, the ability to just be able to click on the link instead of worrying about formatting would be a great addition to the approval queue. It works with correspondence and comments.

Here is my Template:

===Create-Ticket: approval
Queue: ___Approvals
Type: approval
AdminCc: {$Tickets{‘TOP’}->FirstCustomFieldValue(‘OracleApprovers’)};
Cc: username@domain.com
Depended-On-By: TOP
Refers-To: TOP
CF-ApprovalType: Oracle
Due: {time + 86400}
Subject: Oracle Approval for ticket: {$Tickets{“TOP”}->Id} - {$Tickets{“TOP”}->Subject}
Content: Your approval is required to grant access to Oracle for {$Tickets{‘TOP’}->FirstCustomFieldValue(‘UserDisplayName’)}

To respond to this request, please click the following link to access your pending approvals:

http://rt.domain.com/Approvals

OR

You may submit your response via e-mail. To do so, reply to this message with one of the following responses in the body of the message:

To approve:
Status: Resolved

To reject:
Status: Rejected

To view the original request, follow this link: {RT->Config->Get(‘WebURL’)}Ticket/Display.html?id={$Tickets{‘TOP’}->Id}

The actual approval request is below:
{$Tickets{‘TOP’}->Transactions->First->Content()}

ENDOFCONTENT

I just tried that, still didn’t work. I was able to include it into the AdminCCTransaction template and it works. But it just doesn’t seem to work for me when I tried it as part of a template to create a child ticket. I’ve gotten around it by modifying the template that is used in the scrip On Create Notify AdminCcs. This works, it just means that the formatting is not completely ideal.From: adam brown [mailto:ajaxbro@yahoo.com]
Sent: Thursday, January 20, 2011 1:26 PM
To: rt-users@lists.bestpractical.com; Jennifer Koermer
Subject: Re: [rt-users] Template Help

Did you try just {$Ticket->id}? Works for me.

Request {$Ticket->id} was been created on {$Transaction->CreatedAsString}

I just tried that, still didn’t work. I was able to include it into the AdminCCTransaction
template and it works. But it just doesn’t seem to work for me when I tried it as part of a
template to create a child ticket. I’ve gotten around it by modifying the template that is
used in the scrip On Create Notify AdminCcs. This works, it just means that the formatting is
not completely ideal.

RT can’t know the id of the ticket that will be created, sending this
notification from __Approvals is the right place to do it. You could
use the New Pending Approval template, but I think that only notifies
Owners.

-kevin