[rt-users] Forcing a custom field to be a mandatory date

Kenneth Crocker kfcrocker at lbl.gov
Mon Apr 11 14:12:13 EDT 2011


Vance,

Well, there are a few vastly different ways to do this:

1) If on rt 3.6.x, you can use any of these formatting sequences:

# for format control of "mm/dd/yyyy"

(?#Date
mm/dd/yyyy)^(((0)?[1-9]|1[0-2])\/((0)?[1-9]|[12][0-9]|3[01])\/([12][0-9])?[0-9][0-9])?$

# for format control of "yyyy/mm/dd hh:mi:ss"

(?#Date yyyy/mm/dd
hh:mi:ss)^(([1-2][0-9][0-9][0-9])\/(0[1-9]|1[0-2])\/(0[1-9]|[1-2][0-9]|3[0-1])
(0[1-9]|1[0-2]):(0[1-9]|1[0-2]):(0[1-9]|1[0-2]))?$

# for format control of "yyyy/mm/dd"

(?#Date
yyyy/mm/dd)^(([1-2][0-9][0-9][0-9])\/(0[1-9]|1[0-2])\/(0[1-9]|[1-2][0-9]|3[0-1]))?$

2) If on 3.8.8+, you can make the CF a "SelectDate" field and get the use of
Calendar. However, there is no "built-in" way to make the field mandatory
unless you add some of your own code. This has been discussed in past
threads. We choose to keep the basic code and work around the problem by
writing a scrip to use another CF and re-set the Status field (to "stalled"
when they "resolve" without setting the date field) and then send email
notifications to alert the ticket owners that they need to put in the date
field). This is a bit simple, but keeps us from messing with code. However,
there are some other options discussed that modify the RT code and allow the
CF to be treated as a "TRULY" mandatory field. Check out the threads. I
believe there is even a link to some of that code.

Hope this helps.

Kenn
LBNL

On Mon, Apr 11, 2011 at 6:30 AM, Vance Walsh <vance_walsh at concordacademy.org
> wrote:

>  What would be the proper string to make a Custom field Mandatory and
> contain a date field?
>
> ---
>
> Vance Walsh
> Network and Systems Administrator
> Concord Academy - Concord, Mass.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20110411/3a3ebdc6/attachment.htm>


More information about the rt-users mailing list