Modified custom field in scrip I can not show in template


#1

I have successfully changed value of my custom field on ticket creation via Scrip using this solution
http://kb.mit.edu/confluence/display/istcontrib/Set+an+RT+Custom+Field+automatically+on+ticket+creation
so now in Custom Fields section of Ticket metadata in RT i can see that value has changed, in History section I see The RT System itself - custom field (value1) changed to value2
Problem is I can not see changed value instead of old value in template execution where I use following to write custom field value in mail response {$Ticket->FirstCustomFieldValue(‘My custom field4:’)}, this simply writes value I enter during ticket creation or nothing if nothing is entered in My custom field4 .

RT 4.0.7

Any help is greatly appreciated

thank you in advance,
Nikola


#2

Hello Nikola,

am I getting you right, you want to shown the new value in your mail response?

In my opinion changing the value of an custom field is a transaction (of the type ‘set’ ).
So {$Transaction->NewValue} should work in your template.

Greetings
Patrick


#3

This template you mention - would this be the AutoReply template? If that is the case, maybe the autoreply is generated and sent before the custom field is modified?

/Lars


#4

@Lars That’s exactly what I thought, yes template is of Autoreply sort, I was expecting to catch it in template/mail via $Ticket->FirstCustomFieldValue(‘Modified CF:’) but that didn’t work, solution was
to put {$Transaction->CreatorObj->Organization} in template to catch user organization
@Patrick you were close but if wanted value that wasn’t something already filled in users profiles but lets say some computed value I still don’t know how would I pass that value to mail via template, so I guess both answers are close to truth…
anyway thank you for replies

NikolaB