Macros
A macro is a ready-made set of actions an operator applies to a ticket in one click. Macros are shared across the project: every operator sees them, and a macro can't be limited to a department.
Creating a macro
Open Settings → Macros and click Create Macro. Fill in:
- Name and Description — what the operator sees in the list.
- Actions — switch on the ones you need. They run in this order:
- Run a script — up to three of the project's scripts, in order, like the Run button in the ticket's Tools. Only on a plan with scripts. More below.
- Send Reply — text sent to the customer on the operator's behalf. With Internal Note ticked it becomes a note the customer doesn't see.
- Change Status — New, Open, In Progress, Resolved or Closed.
- Assign Operator — pick the operator from the project's operators.
- Transfer to Department — pick the department from the project's departments. This action is only there if your plan includes departments.
- Add Tags and Remove Tags — comma-separated.
- Actions in BILLmanager — only if the project has a BILLmanager channel: Prolong the service for free, Add a bonus to the balance and Ticket's service (suspend, resume or reboot the VPS). They always run last, in this order. More below.
Reorder macros with Move up and Move down. The Usage count shows next to each.
Variables in the reply
Below the reply box are the variables: click one to put it at the cursor. The values are filled in when the macro runs.
{{contact.name}},{{contact.email}},{{contact.telegram}},{{ticket.id}},{{ticket.subject}},{{ticket.status}},{{operator.name}},{{workspace.name}}— the customer, the ticket, the operator and the project, as in reply templates.{{service.name}},{{service.ip}},{{service.tariff}},{{service.paid_until}},{{client.balance}}— the service the BILLmanager ticket is about and the customer's balance, read from BILLmanager when the macro runs. With a prolongation or a bonus in the macro, the date and the balance are the ones after them.
If a variable has no value (the ticket has no service, BILLmanager didn't answer, the customer has no Telegram), the reply doesn't go out with a hole: the whole macro doesn't run, and the operator sees which variable was missing. The editor won't save an unknown variable like {{service.…}}.
Scripts in a macro
- The script is picked from the project's switched-on scripts (Settings → Scripts), and the values follow the description of its parameters. Up to three steps, reordered with Move up and Move down.
- Text values take the reply's general variables:
{{contact.name}},{{contact.email}},{{contact.telegram}},{{ticket.id}},{{ticket.subject}},{{ticket.status}},{{operator.name}},{{workspace.name}}. They are filled in as they are when the macro runs, and then the values are checked as Run checks them: the required ones are there, a whole number is whole, nothing longer than 500 characters. A whole-number parameter takes no variable, only the number itself: a ticket number is sometimes all digits and would become a number nobody set. BILLmanager service data goes into the reply only. - The customer's data in the values is the verified kind only, as in any lookup in the project's systems. A widget visitor's email is whatever they typed and nobody checked it: it doesn't go into a script, and a customer without a name doesn't get it in place of the name. A step that needs such a value doesn't run and says why.
- The script runs on behalf of whoever applies the macro, the same way as Run in the ticket's Tools: an action only the owner and admins may run won't run for an operator, the run counts toward their limit of 30 runs an hour in the project, and the same action with the same values never runs twice at once (the assistant's run included). So two identical action steps with the same values in one macro won't both run: the second runs into the first and stops the macro. The run goes to the script's journal and the ticket's history, and nothing goes to the customer.
- What can be seen in advance — the plan, a switched-off script, the right to run it, a value that's unverified or missing, a value the script won't take — is checked before the first step. Such an action keeps the whole macro from running, as BILLmanager steps do. Such a check is skipped with its reason, and the macro goes on.
- Scripts run first, then the reply, the status and the rest. If a script action doesn't go through — an error, the time ran out, a refusal — the macro stops there: the reply isn't sent, since it could tell the customer about something that wasn't done, and the status and the other steps stay as they were. A check that fails doesn't stop the macro. All scripts of one run fit in 100 seconds: a step that might not have the time left isn't started, and if it's an action, the macro stops there.
- While the scripts run, the ticket may change: someone takes it, closes it, tags it. So after them the macro reads the ticket again and checks the rights once more. If, say, another operator has taken the ticket, the reply and the other steps don't run, and the operator sees why. Someone else's tags and close aren't overwritten.
- A macro with a script action, like one with money in BILLmanager, first shows which script runs with which values, and runs only on Run. If the ticket's customer isn't confirmed by the channel (say, a widget visitor not signed in on the site), the window warns that the data may not be theirs. If the values changed while the window was open, it shows the new ones. Checks don't ask for confirmation. After the run the operator sees what each script returned, as in the ticket's Tools. In streamer mode the values and results are blurred.
- If the answer doesn't come (the connection dropped, the proxy gave up), the operator sees “No answer came — the macro may have run, check the ticket's history”. Running the same macro again on the same ticket from the same browser tab within 10 minutes, after a page reload too, doesn't run it a second time: the server returns the first run's answer, and the window says it's the earlier run's answer, or says the run is still going. From another tab, another device or later the macro runs anew, so check the ticket's history first.
- Without a plan with scripts the step isn't offered. A step saved earlier shows in the editor with the plan's banner and can be removed, and at run time it's refused: an action keeps the macro from running, a check is skipped. The editor won't save a switched-off or another project's script, an unknown parameter, an empty required one, an unknown variable or a variable in a whole number.
Actions in BILLmanager
- Every action is on the service the BILLmanager ticket is about (SupportHub reads it from BILLmanager when the macro runs), and only if the service belongs to this ticket's customer. The macro stores no service number.
- Ticket's service: Suspend and Resume do what the Stop and Start buttons in the customer card do, and Reboot the VPS is for VPS only. Needs the channel's “Manage VM” permission.
- Prolong the service for free moves the paid-until date on by the given number of days, with no charge to the customer (for a lapsed service, from today). Prolonging doesn't start a suspended service — add Resume to the same macro: it runs after the prolongation. For VPS and dedicated servers.
- Add a bonus to the balance — an amount in the currency of the customer's account and a comment (it becomes the payment's purpose). BILLmanager gets a payment with the payment method chosen in the channel card, credited right away. BILLmanager sends the customer its usual payment notification.
- Money (prolongation and bonus) runs only for someone with the channel's “Money: free prolongation and bonuses” permission. At first only the project owner has it, and only the owner can grant it.
- The owner sets the limits in the BILLmanager channel card, Permissions tab: how many days one macro may prolong (30 by default), the largest bonus (bonuses are off until it's set) and the payment method for bonuses. They're checked when a macro is saved and on every run. Above them is the platform ceiling of 365 days and 100,000.
- On a module channel (v2), reboot, prolongation and bonuses need SupportHub module 1.0.0-14 or later on the BILLmanager server. With an older module these steps don't run, and the confirmation window says “Update the SupportHub module on the BILLmanager server to 1.0.0-14”. Suspend, resume and the variables work with any version. Prolongation and bonuses also need “Allow prolongation and bonuses” ticked in the SupportHub gateway in BILLmanager (off by default).
How operators apply a macro
The ticket's reply box has a Macros button (Ctrl+Shift+M): the operator picks a macro and all its actions run on that ticket right away. A macro only works on a ticket the operator can access by department, just like the ticket's buttons.
Permissions for the actions themselves are checked for the whole macro before the first action. A note, closing (Resolved, Closed), reopening to Open and tags are open to any operator. A reply to the customer, assigning an operator, a department transfer and other status changes are for the ticket's assignee, anyone while the ticket is unassigned, and the owner and admins on any ticket. If any action isn't allowed for the operator, the whole macro is refused (the API answers 422).
A macro with actions in BILLmanager first shows exactly what it will do — “Prolong service VPS #632 until 08.10.2026”, “Add 500 € to the balance of Sergey” — and runs only on Run. If something won't go through (no permission, no service on the ticket, a limit exceeded), the same window says so and the macro doesn't run at all. Clicking again doesn't run it a second time. If a step fails while running, the remaining BILLmanager steps don't run, and the operator sees a step-by-step report: what was done, what wasn't and why. Each action in BILLmanager leaves an internal note in the ticket and an audit log entry.
How a macro changes the status
- Closed — a full close, as with the Close button: the customer gets a closing message and, if enabled, a rating request, the card in the Telegram group is updated, and the BILLmanager ticket is closed.
- Resolved — the same as moving the card to “Resolved” on the board: a snoozed ticket is resumed first, and the BILLmanager ticket is closed. A macro doesn't turn a closed ticket into Resolved — it stays closed.
- New, Open, In Progress — a closed or resolved ticket is reopened first, as with the Reopen button, and a snoozed one is resumed, as with the Resume button. Then the status changes the same way as when you move the card on the board.

