Commit 0463bab1 authored by Jim Brandt's avatar Jim Brandt
Browse files

Add exception for TimeTaken on create

TimeTaken is only relevant on update, so skip if validating
on create.
parent 04f33e13
......@@ -312,11 +312,20 @@ sub CheckMandatoryFields {
# Check core fields, after canonicalization for update
for my $field (@$core) {
# Will we have a value on update?
# If we have a Ticket, it's an update, so use the CORE_FOR_UPDATE values
# otherwise it's a create so use raw field value with no UPDATE prefix
my $arg = $args{'Ticket'} ? $CORE_FOR_UPDATE{$field} || $field
: $field;
my $arg;
if ( $args{'Ticket'} ){
$arg = $CORE_FOR_UPDATE{$field} || $field;
}
else{
# It's create. No TimeTaken on create form.
next if $field eq 'TimeTaken';
$arg = $field;
}
next if defined $ARGSRef->{$arg} and length $ARGSRef->{$arg};
# Do we have a value currently?
......
......@@ -33,10 +33,10 @@ sub import {
$args{'config'} =<<CONFIG;
Set( %MandatoryOnTransition,
'*' => {
'open -> resolved' => [qw(TimeWorked)]
'open -> resolved' => [qw(TimeWorked TimeTaken)]
},
'General' => {
'* -> resolved' => ['TimeWorked', 'CF.Test Field']
'* -> resolved' => ['TimeWorked', 'TimeTaken', 'CF.Test Field']
},
);
CONFIG
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment