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
- You must have permission to edit Smart Rules in HappyFox Help Desk.
- To restrict a workflow to business hours, a Work Schedule must already be configured in HappyFox Help Desk. See how to create and manage Work Schedules.
- The workflow you want a Smart Rule to trigger must already exist in HappyFox Workflows, with its trigger type set to Smart Rule.
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.
- In HappyFox Workflows, create a new workflow and set its trigger type to Smart Rule.
- In HappyFox Help Desk, navigate to Automate > Smart Rules and create a new Smart Rule, or open an existing one to edit.
- In the Choose Action step, set the action to Trigger Workflow and select the workflow from step 1.
- In the Set Conditions step, click + to open Add Condition.
- Select Time since ticket created from the condition dropdown.
- Set the operator to is.
- Enter a number and select a unit — minutes, hours, or days — then click Add.
- In the About step, enter a Name for the Smart Rule, then toggle Enable Smart Rule on.
- 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
- Due Date — operators: on, in, is gone past by, is not set, is set
- Due By — operators: on, in, is gone past by
- Agent message is unresponded — operator: for, with a number and unit (minutes/hours/days)
- Contact message is unresponded — operator: for, with a number and unit (minutes/hours/days)
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.
- 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.
- In the Set Conditions step, add any conditions you need — for example, one of the time-based conditions from the previous section.
- In the About step, select the schedule you want from the Work Schedule dropdown — for example, Default Work Schedule or a named custom schedule.
- 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.
- 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.
- Set Transformations to Format Date.
- Click Insert Merge Fields next to Date to Transform and select the ticket's Created On field.
- Set From Format to YYYY-MM-DDTHH:mm:ssZ.
- Set To Format to Relative Date (Today, Tomorrow, Yesterday).
- 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.