Skip to content

How to Include Date-Based Conditions and Triggers in HappyFox Workflows

Views
3
Last updated

This article explains how to trigger a HappyFox Workflow based on how long a ticket has gone untouched, restrict a workflow to specific business hours, and reference a ticket's date fields as a relative, human-readable value within a workflow.

Applicable Plans: Available on all plans.

Prerequisites

Date-based conditions in HappyFox Workflows come from Smart Rules in HappyFox Help Desk — a native Help Desk feature, distinct from Workflows itself. A Smart Rule evaluates its conditions and, when they match, can call a workflow directly. The sections below cover the three most common ways to use this.


Trigger a workflow after a ticket sits untouched

Use a Smart Rule's time-based conditions to trigger a workflow only after a ticket has gone a set amount of time without activity — for example, sending a reminder if a ticket sits untouched for three days.

  1. In HappyFox Workflows, create a new workflow and set its trigger type to Smart Rule.
  2. In HappyFox Help Desk, navigate to Automate > Smart Rules and create a new Smart Rule, or open an existing one to edit.
  3. In the Choose Action step, set the action to Trigger Workflow and select the workflow from step 1.
  4. In the Set Conditions step, click + to open Add Condition.
  5. Select Time since ticket created from the condition dropdown.
  6. Set the operator to is.
  7. Enter a number and select a unit — minutes, hours, or days — then click Add.
  8. In the About step, enter a Name for the Smart Rule, then toggle Enable Smart Rule on.
  9. Save the Smart Rule.

Eg: The Add Condition with "Time since ticket created" set to "is 3 days."

Note: The workflow only runs if the Smart Rule's action is set to Trigger Workflow with the correct workflow selected. A Smart Rule left on a different action, or pointed at the wrong workflow, will not trigger it .

Other time-based conditions available in Smart Rules

Note: The in and is gone past by operators for Due Date and Due By only accept a number of days — there's no minutes or hours option for these two conditions.


Restrict a workflow to business hours

Use a Work Schedule linked to a Smart Rule to limit a workflow so it only runs on the days and during the hours your team works.

  1. Follow steps 1–3 above to create a workflow with trigger type Smart Rule, then create or edit a Smart Rule with its action set to Trigger Workflow.
  2. In the Set Conditions step, add any conditions you need — for example, one of the time-based conditions from the previous section.
  3. In the About step, select the schedule you want from the Work Schedule dropdown — for example, Default Work Schedule or a named custom schedule.
  4. Toggle Enable Smart Rule on and save.

Note: Associating a Work Schedule with a Smart Rule restricts trigger evaluation to that schedule's configured working hours and days. Outside those hours, the workflow does not run, even if the Smart Rule's other conditions are met.

To change which days or hours count as business hours, edit the Work Schedule itself rather than the Smart Rule. See how to create and manage Work Schedules.


Reference a ticket's age as a relative date

Use the Date/Time Formatter action to convert a ticket's date field into a plain-language expression like "5 days before," then use that value in a later step — for example, giving an agent context when a ticket is escalated.

  1. In the workflow, add a Date/Time Formatter action at the point where you want to generate the relative date — for example, just before an escalation or forwarding action.
  2. Set Transformations to Format Date.
  3. Click Insert Merge Fields next to Date to Transform and select the ticket's Created On field.
  4. Set From Format to YYYY-MM-DDTHH:mm:ssZ.
  5. Set To Format to Relative Date (Today, Tomorrow, Yesterday).
  6. Add the action that uses this value — for example, Add Private Note — and insert the Date/Time Formatter's Transformed Value into the note text, such as: "Escalated ticket — originally created {Transformed Value}."

The Date/Time Formatter action configured with Created On as the input and Relative Date as the output format.

Note: The Relative Date output describes the date's distance from today — for example, "5 days before" — not the original date and time. If you need the exact original timestamp elsewhere in the workflow, reference the ticket's date field directly instead of the transformed value.