set company_id [db_string ticket_company "select company_id from im_projects where project_id = :parent_id" -default ""]
set company_id [db_string ticket_company "select company_id from im_projects where project_id = :parent_id" -default ""]
if {"" == $company_id}{
if {"" == $company_id}{
return [im_rest_error -format $format -http_status 406 -message "Invalid $rest_otype_pretty field 'parent_id': parent_id should represent an 'open' project of type 'Service Level Agreement'."]
return [im_rest_error -format $format -http_status 406 -message "Invalid $rest_otype_pretty field 'parent_id': parent_id should represent an 'open' project of type 'Service Level Agreement'. This SLA will become the container for the ticket."]