I successfully added this hook to my custom_function_inc.php file and it is working:
Code: Select all
/** * Hook to validate Validate field settings before resolving
* verify that the Fixed In Version is set (if versions of the product exist) */
function custom_function_override_issue_update_validate( $p_issue_id, $p_bug_data, $p_bugnote_text ) {
if( $p_bug_data->status == RESOLVED ) {
$t_version_count = count( version_get_all_rows( $p_bug_data->project_id ) );
if( ( $t_version_count > 0 ) && ( $p_bug_data->fixed_in_version == '' ) ) {
error_parameters( 'Fixed In Version' );
trigger_error( ERROR_EMPTY_FIELD, ERROR );
}
}
}
Code: Select all
# Check to see if bug has Product Version set:
function custom_function_overrride_issue_create_validate( $p_new_issue_data ) {
error_parameters( 'product_version' );
trigger_error( ERROR_EMPTY_FIELD, ERROR );
}