Skip to main content

Custom Actions

Custom Actions allow you to extend the Ticket page with your own functionality. Using HD Form Scripts, you can add buttons, dropdown actions, dialogs, API integrations, and other workflows directly to the ticket interface.

Whether you want to integrate with external systems, update ticket fields, create related records, or automate repetitive tasks, Custom Actions let you tailor the Ticket page to match your organization’s workflow.

Tip

Use Custom Actions to reduce repetitive work by placing frequently used operations directly on the Ticket page instead of navigating through multiple screens.

Create a Custom Action

Custom Actions are created using HD Form Scripts in Desk.

  1. Open Desk.
  2. Navigate to HD Form Script.
  3. Create a new script or edit an existing one.
  4. Select the required Doctype (for example, HD Ticket).
  5. Set Apply To as Form.
  6. Add your custom action code.
  7. Enable and save the script.

Types of Custom Actions

HD Form Scripts support multiple action layouts depending on your workflow.

Single Button

A single action button appears directly in the Ticket header. Clicking the button executes the configured function, such as opening another application, calling an API, or updating the current ticket.

You can customize the appearance of the button using optional properties such as:

  • Variant — Solid, Subtle, Outline, or Ghost.
  • Theme — Gray, Blue, Green, or Red.
  • Class — Apply custom Tailwind CSS classes for additional styling.

Grouped Actions

Multiple actions can be organized under a single three-dot menu. This keeps the interface clean while providing quick access to related actions.

Each group can contain multiple action items, each with its own click handler.

Dropdown Button

Instead of displaying actions under the overflow menu, you can create a dropdown button with a custom label such as Reports, Actions, or Utilities.

Selecting an item from the dropdown executes the corresponding action.

Combined Actions

You can combine standalone buttons and grouped dropdown actions within the same script, allowing important actions to remain visible while less frequently used actions stay organized inside menus.

Using Ticket Context

Form Scripts receive access to the current Ticket through the doc object.

This allows your actions to work with information from the currently opened ticket.

  • doc.name — Current ticket ID.
  • doc.customer — Customer information.
  • doc.raised_by — User who created the ticket.
  • Access any other field available on the Ticket document.

Available Helper Functions

HD Form Scripts provide several helper functions for building interactive workflows.

  • call() — Execute server-side APIs or Server Scripts.
  • updateField() — Update a Ticket field programmatically.
  • router — Navigate to another page within the application.
  • $dialog() — Display confirmation dialogs or custom modal windows.
  • createToast() — Show success, warning, or error notifications.

Script Options

HD Form Scripts include additional configuration options that determine where the script will run.

  • Enabled — Activates the script for the Agent Ticket View.
  • Apply to Customer Portal — Makes the script available in the Customer Portal.
  • Apply on New Page — Executes the script while creating a new ticket.

Function Availability

Not every helper function is available on every page.

Function Agent Ticket Customer Portal New Ticket
call()
updateField()
router
$dialog()
createToast()
applyFilters()

Example Use Cases

Custom Actions can be used to automate common support workflows, such as:

  • Open related records or external applications.
  • Display additional information in a dialog.
  • Close or update tickets with a single click.
  • Create linked documents.
  • Call custom APIs to retrieve or update information.
  • Show confirmation dialogs before performing important actions.

Flexible Workflows

You can combine buttons, dropdown menus, dialogs, API calls, and field updates within a single Form Script to build workflows tailored to your support team’s requirements.

Best Practices

  • Keep frequently used actions as visible buttons.
  • Group less common actions inside dropdown menus.
  • Use confirmation dialogs before destructive operations such as closing tickets.
  • Display toast notifications after successful actions to provide user feedback.
  • Reuse server-side APIs through call() whenever business logic is shared.
  • Test Form Scripts thoroughly before enabling them for production users.

Note

Custom Actions are implemented entirely through HD Form Scripts. Depending on where the script is configured, the same action can be made available to support agents, Customer Portal users, or during new ticket creation.

Rating: 0 / 5 (0 votes)