Support

Pre-sales

#39485 Using ATS with Convert Forms

Posted in ‘Pre-sales and Account Questions’
This is a public ticket

Everybody will be able to see its contents. Do not include usernames, passwords or any other sensitive information.

Latest post by nicholas on Sunday, 17 September 2023 01:47 CDT

Malkio

Story: "I want the ability to send submissions from the Convert Forms Joomla! extension to The Akeeba Ticketing System (ATS). However, there is no apparent API availability via ATS, as per the support documentation. I'm looking for a method or workaround to achieve this integration."

Problem statement: There is no API available in The Akeeba Ticketing System's support documentation, which makes it challenging to integrate Convert Forms submissions with ATS.

Desired behavior: Find a solution or workaround to enable the seamless transfer of submissions from Convert Forms to The Akeeba Ticketing System.

Possible solution: Explore if Convert Forms has any built-in integrations or options to connect with ATS. If not, consider building a custom integration or using an intermediary service like Zapier or Make.com to bridge the gap. I understand this on the CF side but not the ATS side.

Possible alternative: If direct integration isn't possible, maybe using email notifications from Convert Forms and set up email parsing in ATS to automatically create tickets based on the received submissions. With your expertise of ATS would that make sense or be doable?

Any guidance is appreciated.

nicholas
Akeeba Staff
Manager

ATS is a Joomla! component. Convert Forms is a Joomla! component. They run on the same site. You do not need an API.

ATS uses the standard Joomla! 4 MVC. Convert Forms allows you to use custom PHP code. You could, therefore, figure out how to post tickets like that. The overall idea is this:

// Get the ATS Ticket and Post tables 
$mvcFactory = \Joomla\CMS\Factory::getApplication() ->bootComponent('com_ats') ->getMVCFactory();
$ticket = $mvcFactory->createTable('Ticket', 'Administrator');
$post = $mvcFactory->createTable('Post', 'Administrator');

// Create the ticket, telling ATS to ignore the current user's permissions
\Akeeba\Component\ATS\Administrator\Table\TicketTable::$overrideuser = true;
if (!$ticket->save($ticketData)) {
// You have an error. Handle it.
}
\Akeeba\Component\ATS\Administrator\Table\TicketTable::$overrideuser = false;

// Create the post
$post->ticket_id = $ticket->getId();
$post->created_by = $ticket->created_by;
$post->save($postData);

$ticketData is the PHP array with the ticket data. The keys of the array are the same as the #__ats_tickets table fields. Do not provide a value for the id field; leave it null. If you are submitting a Guest Ticket you MUST provide three additional keys: name, username, and email.

Likewise, $postData is the PHP array with the first post's data for the ticket. They keys of the array are the same as the #__ats_posts table fields. Do not provide a value for the id field; leave it null.

You would of course need to check if there is an existing user logged in, or one which already exists with this email the visitor provided, and use their user ID. You need to figure out how to create the arrays from the form data. These are beyond the scope of what we can help with, but at least you've got a pretty good idea of how to proceed.

You can use this concept even with Akeeba Ticket System Core. You just won't be receiving any emails on ticket submission, but your tickets will be created.

Nicholas K. Dionysopoulos

Lead Developer and Director

🇬🇷Greek: native 🇬🇧English: excellent 🇫🇷French: basic • 🕐 My time zone is Europe / Athens
Please keep in mind my timezone and cultural differences when reading my replies. Thank you!

Support Information

Working hours: We are open Monday to Friday, 9am to 7pm Cyprus timezone (EET / EEST). Support is provided by the same developers writing the software, all of which live in Europe. You can still file tickets outside of our working hours, but we cannot respond to them until we're back at the office.

Support policy: We would like to kindly inform you that when using our support you have already agreed to the Support Policy which is part of our Terms of Service. Thank you for your understanding and for helping us help you!