Question about rt-extension-extractcustomfieldvalues design

Is there some reason extractcustomfieldvalues does it’s work in Commit
instead of Prepare? I would think it fairly common to want to use {
$Ticket->FirstCustomFieldValue(‘foo’) } in email templates, but
since extractcustomfieldvalues does it’s work in Commit and the templates
are evaulated in Prepare, even scrip ordering doesn’t make this possible.

Thanks.

-Todd

Is there some reason extractcustomfieldvalues does it’s work in Commit instead
of Prepare?

…because that’s when you’re supposed to actually do the work. What
you’re looking for is a sensible request and is something we intend to
address when we get Scrips’ replacement out the door.

Is there some reason extractcustomfieldvalues does it’s work in Commit
instead
of Prepare?

…because that’s when you’re supposed to actually do the work. What
you’re looking for is a sensible request and is something we intend to
address when we get Scrips’ replacement out the door.

Interesting that the work of evaluating the template is done in Prepare.

What is the status of the scrips replacement? It a preview available on the
github repo?

Also, will scrips for objects other that tickets be supported?

Unless I misunderstand what you are asking, I think this actually does work. Here’s part of a template I did yesterday:

This unowned ticket has just been assigned to the {
if ($Transaction->Type eq “Create”) {
$OUT .= $Ticket->FirstCustomFieldValue(“RequestingUnit”);
} else {
$OUT .= $Transaction->NewValue();
}
} Area of Responsibility. Please review this ticket and take or assign ownership as appropriate.

The RequestingUnit value gets populated appropriately when doing a Create transaction, which means that the call to FirstCustomFieldValue() worked.

Is that not what you are trying to do?

-Fran

PS – The purpose of my template is to notify certain people when RequestingUnit is first populated or is changed, hence the branching logic. I think I had to call NewValue() in the case of a CustomField transaction because FirstCustomFieldValue was giving me the old value instead of the new one… I can’t quite recall, but in any case, calling FirstCustomFieldValue() from a template appears to be working fine.From: rt-devel-bounces@lists.bestpractical.com [mailto:rt-devel-bounces@lists.bestpractical.com] On Behalf Of Todd Chapman
Sent: Sunday, October 24, 2010 10:57 AM
To: RT developers
Subject: [Rt-devel] Question about rt-extension-extractcustomfieldvalues design

Is there some reason extractcustomfieldvalues does it’s work in Commit instead of Prepare? I would think it fairly common to want to use { $Ticket->FirstCustomFieldValue(‘foo’) } in email templates, but since extractcustomfieldvalues does it’s work in Commit and the templates are evaulated in Prepare, even scrip ordering doesn’t make this possible.

Thanks.

-Todd

What populates RequestingUnit? You are probably not using
ExtractCustomFieldValues for that.On Mon, Oct 25, 2010 at 10:04 AM, Francis L Fabrizio fabrizio@uab.eduwrote:

Unless I misunderstand what you are asking, I think this actually does
work. Here’s part of a template I did yesterday:


This unowned ticket has just been assigned to the {

if ($Transaction->Type eq “Create”) {

 $OUT .= $Ticket->FirstCustomFieldValue("RequestingUnit");

} else {

 $OUT .= $Transaction->NewValue();

}

} Area of Responsibility. Please review this ticket and take or assign
ownership as appropriate.


The RequestingUnit value gets populated appropriately when doing a Create
transaction, which means that the call to FirstCustomFieldValue() worked.

Is that not what you are trying to do?

-Fran

PS – The purpose of my template is to notify certain people when
RequestingUnit is first populated or is changed, hence the branching logic.
I think I had to call NewValue() in the case of a CustomField transaction
because FirstCustomFieldValue was giving me the old value instead of the new
one… I can’t quite recall, but in any case, calling FirstCustomFieldValue()
from a template appears to be working fine.

From: rt-devel-bounces@lists.bestpractical.com [mailto:
rt-devel-bounces@lists.bestpractical.com] *On Behalf Of *Todd Chapman
Sent: Sunday, October 24, 2010 10:57 AM
To: RT developers
Subject: [Rt-devel] Question about rt-extension-extractcustomfieldvalues
design

Is there some reason extractcustomfieldvalues does it’s work in Commit
instead of Prepare? I would think it fairly common to want to use {
$Ticket->FirstCustomFieldValue(‘foo’) } in email templates, but
since extractcustomfieldvalues does it’s work in Commit and the templates
are evaulated in Prepare, even scrip ordering doesn’t make this possible.

Thanks.

-Todd

Sorry Todd, I missed the context and read “I would think it fairly common to want to use { $Ticket->FirstCustomFieldValue(‘foo’) } in email templates” as a blanket statement that it doesn’t work. My bad. :slight_smile:

-Fran

Hi,

One way to go is staging notifications at batch stage.

Regards, Ruslan. From phone.2010 10 24 19:57 пользователь “Todd Chapman” todd@chaka.net написал:

Is there some reason extractcustomfieldvalues does it’s work in Commit
instead of Prepare? I would think it fairly common to want to use {
$Ticket->FirstCustomFieldValue(‘foo’) } in email templates, but
since extractcustomfieldvalues does it’s work in Commit and the templates
are evaulated in Prepare, even scrip ordering doesn’t make this possible.

Thanks.

-Todd