Conditional fields (or how to ask clients for additional information)

Those of us doing support for web software have often found ourselves in need to ask our clients for connection information. The problem with that is two–fold. If we ask for that information as custom fields when the ticket is first submitted we create the false expectation that we will get into the site ourselves and do all the work for the user meaning a lot more work for us and the client having no idea what we did to fix their problem (which means many more tickets from that client). If we don't ask for this information in custom fields we are effectively trusting that the user will somehow follow our instructions and provide the information we are asking them for. Unfortunately, even with very detailed instructions on what we need, this is rarely the case. This causes support delays.

Is it a lost cause? Are we bound by a chicken and egg issue which make our work harder? Not with the power of custom fields AND the nifty Content – Akeeba Ticket System Custom Fields Show–on Behavior plugin we ship with Akeeba Ticket System.

This is going to be a longer tutorial. We will need to create five custom fields:

  1. A Site Administrator Login URL where the user will give us the URL to their site's administrator login.

  2. A Username field for the administrator login.

  3. A Password field for the administrator password.

  4. An Additional Information text field where the user can communicate additional security measures which may be in place (e.g. an administrator directory password, Two Factor Authentication settings etc)

  5. An Ask For Additional Information field only visible to the support staff controlling the display of the previous four fields.

Everything will be placed in a Site Connection Information field group to keep it neat and tidy.

The first four fields will be displayed in the ticket view to support staff and the client who owns the ticket only. If the ticket is public, a guest or another client who can view the ticket will NOT be able to view these fields. These fields will be editable by both the client and the support staff. The last field will not be displayed at all in the ticket view and will only be editable by the support staff.

We assume that your support staff belongs in a group title Support Staff and there is a view access level on your site called Support Access which only contains the Support Staff group. We also assume that your clients belong to a user group called Clients and there is a view access level called Client Access which only contains the Clients user group. Moreover, we assume there is a view access level called Ticket Access which includes both the Clients and Support Staff groups. Finally, we assume that you only want these fields to be available to an Akeeba Ticket System category called Software Support.

The custom field group

Go to Components, Akeeba Ticket System, Field Groups. Make sure the drop–down at the top left has Tickets selected. Click on the New button.

  • Title: Site Connection Information

  • Description: Please enter the connection information to your site. After you're done, click on Save & Close. Please remember to send a reply to ticket otherwise we will NOT know that you provided the connection information.

  • Access: Public

Click on Save & Close.

The support staff–only field

The purpose of this field is to act as a toggle. By default it will be set to No, meaning that users will NOT be able to see the fields under the Site Connection Information — this includes the time when they are submitting a new ticket. When the support staff edits the ticket and set the toggle to Yes the fields will become visible to the client who will be able to fill them in.

Go to Components, Akeeba Ticket System, Fields . Make sure the drop–down at the top left has Tickets selected. Click on the New button.

  • Title: Ask For Additional Information

  • Type: Radio (radio)

  • Name: access-info-toggle

  • Label: Ask For Additional Information

  • Description: Does the user need to provide access details?

  • Default Value: 0

  • Field Group: Site Connection Information

  • Category: only select the Software Support category

  • Access: Support Access

In the Radio Values area create two settings:

  1. Text: JNO Value: 0

  2. Text: JYES Value: 1

In the Options tab set the following:

  • Field Class: btn-group

  • Automatic Display: Do not automatically display

In the Permissions tab, select the Support Staff group, set the Edit Custom Field Value to Allowed.

The client-facing fields

The next four fields will be visible to and editable by the users.

Normally, there's a caveat. Joomla uses the Access level to determine both who can view the field values in the ticket view and who can edit their values in the ticket edit page. Here's the problem. If we set the access to Support Access the client can neither see nor edit these fields which beats the purpose of having them. If we set the access to Ticket Access then both the client and the support staff can see and edit these fields. However, all other clients will also be able to see these fields on public tickets which creates a privacy and security issue.

Akeeba Ticket System's Content – Akeeba Ticket System Custom Fields Show–on Behavior plugin has a solution for that. It exposes a custom field parameter called Private Display. When this is enabled, Akeeba Ticket System will only display the values of these fields in the ticket view to the support staff and the ticket owner. Other clients will NOT be able to see them. Therefore you can ask for connection information securely even on a public ticket!

Furthermore, you will notice that we are NOT making these fields required. This is on purpose. Remember that the support staff will set the staff–only Ask For Additional Information field to Yes to “open” the access to the client–facing fields. Because of what we described above, these fields will also be editable by our support staff. If we make them Required then the support staff will have to fill them in to save the ticket when they set Ask For Additional Information to Yes. However, the whole point is that the support staff does not have this information and needs to request it from the user. Unfortunately, we have not found a good solution to this problem so we are just making all fields optional (i.e. Required is set to No).

Without further ado let's start creating our fields.

Go to Components, Akeeba Ticket System, Fields . Make sure the drop–down at the top left has Tickets selected. Click on the New button.

  • Title: Site Administrator Login URL

  • Type: URL (url)

  • Name: admin-login-url

  • Label: Site Administrator Login URL

  • Description: The URL to log into your site's administrator backend.

  • Schemes: HTTP, HTTPS

  • Relative URLs: No

  • Private Display: Yes

  • Field Group: Site Connection Information

  • Category: only select the Software Support category

  • Access: Client Access

In the Options tab set the following:

  • Placeholder: https://www.example.com/administrator/index.php?foobar

  • Showon Attribute: access-info-toggle:1

  • Automatic Display: Before display

In the Permissions tab, select the Support Staff group, set the Edit Custom Field Value to Allowed. Then select the Clients group, set the Edit Custom Field Value to Allowed.

Click the drop-down menu next to Save & Close. Click on Save & New.

  • Title: Username

  • Type: Text (text)

  • Name: username

  • Label: Username

  • Description: The username of a Super User

  • Filter: Text

  • Maximum Length (characters): 100

  • Private Display: Yes

  • Field Group: Site Connection Information

  • Category: only select the Software Support category

  • Access: Client Access

In the Options tab set the following:

  • Placeholder: admin_user

  • Showon Attribute: access-info-toggle:1

  • Automatic Display: Before display

In the Permissions tab, select the Support Staff group, set the Edit Custom Field Value to Allowed. Then select the Clients group, set the Edit Custom Field Value to Allowed.

Click the drop-down menu next to Save & Close. Click on Save & New.

  • Title: Password

  • Type: Text (text)

  • Name: password

  • Label: Password

  • Filter: Raw

  • Maximum Length (characters): 192

  • Private Display: Yes

  • Field Group: Site Connection Information

  • Category: only select the Software Support category

  • Access: Client Access

In the Options tab set the following:

  • Placeholder: password

  • Showon Attribute: access-info-toggle:1

  • Automatic Display: Before display

In the Permissions tab, select the Support Staff group, set the Edit Custom Field Value to Allowed. Then select the Clients group, set the Edit Custom Field Value to Allowed.

Click the drop-down menu next to Save & Close. Click on Save & New.

  • Title: Additional Information

  • Type: Text Area (textarea)

  • Name: additional-info

  • Label: Additional Information

  • Description: Do we need to know anything else to access your site (administrator directory password, two factor authentication settings, geographic IP blocking etc)?

  • Rows: 5

  • Columns: 50

  • Maximum length (characters): 1000

  • Filter: Text

  • Private Display: Yes

  • Field Group: Site Connection Information

  • Category: only select the Software Support category

  • Access: Client Access

In the Options tab set the following:

  • Showon Attribute: access-info-toggle:1

  • Automatic Display: Before display

In the Permissions tab, select the Support Staff group, set the Edit Custom Field Value to Allowed. Then select the Clients group, set the Edit Custom Field Value to Allowed.

Click on Save & Close.

Putting it all together

A client submits a ticket. They do not see the “Site Connection Information” fields at all.

When replying to the client it becomes apparent that the support staff will need access to the client's site to help them out.

The Support Staff edits the ticket and sets the Ask For Additional Information field to Yes.

Then the support staff tells the client that they need to edit their ticket to enter their site connection information.

The client comes to the site and clicks the Edit button for their ticket. They enter the site connection information and clicks on Save & Close.

This causes an automatic message to be posted to the ticket thread, saying that user such–and–such has edited the ticket information. The ticket status is automatically set to Open.

The support staff now comes back to the site. The connection information appears above the conversation tab. This information only appears for the support staff and ticket owner, even if the ticket is Public.