<br><br>On Saturday, February 16, 2013, Kenneth Crocker wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Alex,<div><br></div><div>You need your condition to be user-defined, something like this:</div>
<div><br></div><div><p class="MsoNormal"># Scrip name:
WorkFlow on Next Action</p>
<p class="MsoNormal"># Condition: User Defined</p>
<p class="MsoNormal"># Action: User
Defined</p>
<p class="MsoNormal"># Template: Global
template: Blank</p>
<p class="MsoNormal"># Stage: TransactionBatch</p>
<p class="MsoNormal">#----------------------------------------------------------------------------</p>
<p class="MsoNormal"># Custom condition:</p>
<p class="MsoNormal">#----------------------------------------------------------------------------</p>
<p class="MsoNormal"># Set up initial values</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">my $trans = $self->TransactionObj;</p>
<p class="MsoNormal">my $ticket = $self->TicketObj;</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal"># check for CF "Next Action" is 'Post
Construction', get out if not</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">return ($trans->Type eq "CustomField"
&&</p>
<p class="MsoNormal">
$trans->Field eq "50" &&</p>
<p class="MsoNormal">
$trans->NewValue eq "Post Construction");</p>
<p class="MsoNormal"> </p>
<p class="MsoNormal">return 0;</p><p class="MsoNormal"><br></p><p class="MsoNormal">This allows you to check a specific CF for a specific value.</p><p class="MsoNormal"><br></p><p class="MsoNormal">Kenn</p><br><div class="gmail_quote">
On Fri, Feb 15, 2013 at 4:24 AM, Alex Young <span dir="ltr"><<a href="javascript:_e({}, 'cvml', 'AlexYoung@housingpartners.co.uk');" target="_blank">AlexYoung@housingpartners.co.uk</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi. I'm using RT 4.0.5. I am trying to update the DueDate field with the<br>
contents of a custom field with the datetime content. IT works fine on<br>
creation of the ticket if I set the condition to "On Transaction" or "On<br>
Create" but it doesn't update the DueDate field if the CF is modified<br>
later. Any ideas how I can update DueDate when the CF is modified?<br>
<br>
My scrip is:<br>
Condition: On Transaction<br>
Action: User defined<br>
Template: Global template: Blank<br>
Stage: TransactionCreate (Also tried TransactionBatch)<br>
Custom Condition:<br>
return 1;<br>
Custom action prep code:<br>
return 1;<br>
Custom action cleanup code:<br>
## Turns into yyyy-mm-dd format for date conversion by RT::Date<br>
my $trans = $self->TransactionObj;<br>
my $ticket = $self->TicketObj;<br>
my $cf_date = $ticket->FirstCustomFieldValue('Deployment DateTime');<br>
<br>
my $duedate = RT::Date->new($RT::SystemUser);<br>
$duedate->Set(Format=>'unknown', Value=>$cf_date);<br>
<br>
$ticket->SetDue($duedate->ISO);<br>
<br>
Thanks.<br>
<span><font color="#888888"><br>
<br>
--<br>
RT training in Amsterdam, March 20-21: <a href="http://bestpractical.com/services/training.html" target="_blank">http://bestpractical.com/services/training.html</a><br>
<br>
Help improve RT by taking our user survey: <a href="https://www.surveymonkey.com/s/N23JW9T" target="_blank">https://www.surveymonkey.com/s/N23JW9T</a><br>
</font></span></blockquote></div><br></div>
</blockquote><br><br>-- <br>Sent from Gmail Mobile<br>