<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Matthew,<br>
<br>
Try creating a scrip that has the condition of "OnCreate", an
action as "user-Defined" and put code in the prep action code area that
sets the CF to the value you want (see below). Put "return 1;" in the
clean-up action area. That should do it.<br>
<br>
Prep Action code:<br>
# set the CF Work-Completed Date<br>
<br>
my $trans = $self->TransactionObj;<br>
my $ticket = $self->TicketObj;<br>
my $cf_obj = RT::CustomField->new($RT::SystemUser);<br>
my $cf_name = "Work-Completed Date";<br>
my ( undef, undef, undef, $mon, $day, $year ) = localtime( time );<br>
my $cf_value = sprintf( '%d/%02d/%02d', $year + 1900, $mon, $day );<br>
<br>
$cf_obj->LoadByName(Name=>$cf_name);<br>
$RT::Logger->debug("Loaded\$cf_obj->Name = ". $cf_obj->Name()
."\n");<br>
$ticket->AddCustomFieldValue(Field=>$cf_obj, Value=>$cf_value,
RecordTransaction=>0);<br>
<br>
return 1;<br>
<br>
Kenn<br>
LBNL<br>
<br>
On 6/2/2009 1:41 AM, Matthew Seaman wrote:
<blockquote cite="mid:4A24E5CF.20309@thebunker.net" type="cite">
<pre wrap="">I may be being thick here, but I can't see a way to do this from the web
interface. If I create a custom field of 'Select One Value' type, is
there any way of making one of the values selected by default? The
actual application I'm looking at here is for tracking time spent
working on tickets out of normal business hours, for which we would
charge extra. The vast majority of work will be done during normal
hours, so I'd like that to be the default value.
Cheers,
Matthew
</pre>
<pre wrap="">
<hr size="4" width="90%">
_______________________________________________
<a class="moz-txt-link-freetext" href="http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users">http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users</a>
Community help: <a class="moz-txt-link-freetext" href="http://wiki.bestpractical.com">http://wiki.bestpractical.com</a>
Commercial support: <a class="moz-txt-link-abbreviated" href="mailto:sales@bestpractical.com">sales@bestpractical.com</a>
Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at <a class="moz-txt-link-freetext" href="http://rtbook.bestpractical.com">http://rtbook.bestpractical.com</a></pre>
</blockquote>
</body>
</html>